Configure

Change the database

The databases are stored in the db folder of the yogosell project. The db folder contains two databases:

  • demo.sqlite,
  • db.sqlite,

db.sqlite is the empty database.

The yogosell folder contains the .env.js file. This file contains:

const env = {
  // Define here the credentials to access your database. This hidden file
  // is declared not to be exported in '.gitignore'.
  db: {
    active: 'sqlite',
    sqlite: {
      database: './db/demo.sqlite', // <----- change the database here!
      testdb: 'the path to sqlite test database',
    },
    mysql: {
      host: 'the server domain name',
      connectionLimit: 'the number of simultaneous connections (number)',
      database: 'the database name',
      testdb: 'the test database name',
      user: 'the username with the privileges to access to the database',
      password: 'the username password',
    },
  },
};

Replace ./db/demo.sqlite by ./db/db.sqlite.

Stop Yogosell Server with a CNTRL C command. Then restart it by typing npm start. The active database is now the empty one.

Change the listening port

Open the file server/config.js. It looks like this:

env: {
  staticpage: 'public',
  httpport: 1080,
  httpsport: 1443,
  // By default, HTTPS is active and it is used for all the transactions.
  // It could be disabled for testing purpose.
  https: false,
  // By default, the transactions are authorized for the local machine only.
  // Replace '127.0.0.1' by '0.0.0.0' if you want to authorize the
  // transactions from all the machines on the nework or by the address
  // of the authorized machine.
  // network: '127.0.0.1',
  network: '0.0.0.0',
},

Replace httpport: 1080 by the port you wish to use.

Change the http protocol by https

https requires SSL certificates. If you want to use the https protocol, you must copy your SSL certificates to the server/ssl folder.

This folder expects three named certificates:

server-cert.pem
server-csr.pem
server-key.pem

When your SSL certificates are installed, update server/config.js by replacing https: false, by https: true, and httpsport: 1443, by the port you want to listen on.

-- oOo ---