Get Started

  1. Create config.json to the ./etc dir on sheme:
{
    "serverPort": "8080",
    "db": {
        "username": "username_db",
        "pass": "pass_bd",
        "host": "host_db",
        "port": "port_db",
        "name": "name_db"
    }
}
  1. run
yarn

to instal dependencies

  1. run
yarn build

to building application files

  1. run
yarn start

to start application

Run to Prod

Update app.js:

  1. Uncomment
import https from 'https';
import fs from 'fs';
https.createServer(options, app).listen(serverPort, function() {
  console.log(`Express server listening on port ${serverPort}`);
});
const options = {
  key: fs.readFileSync(path.join(__dirname, './path/to/private.key', 'private.key')),
  cert: fs.readFileSync(path.join(__dirname, './path/to/certificate.srt', 'certificate.srt')),
};
  1. To comment
// import http from 'http';
// http.createServer(app).listen(serverPort, function() {
//   console.log(`Express server listening on port ${serverPort}`);
// });
  1. Create SSL serts in ./path/to/private.key and './path/to/certificate.srt'