Build a blog with Areto Framework

Startup scripts

Create a console directory. There will be located application startup scripts.

The first and main script is the start of the web server. It contains configuration and initialization of the application.

console/start.js

(async ()=> {
  const Application = require('../Application');
  const application = new Application;
  try {
    await application.init();
    await application.start();
  } catch (err) {
    application.logError(err);
    process.exit();
  }
})();

Configuring Visual Studio Code launch:

{
  "configurations": [{
    "type": "node",
    "request": "launch",
    "name": "Start app",
    "program": "${workspaceFolder}/console/start.js",
    "env": {
      "NODE_ENV": "development"
    }
  },{
    "type": "node",
    "request": "launch",
    "name": "Init app",
    "program": "${workspaceFolder}/console/init.js",
    "env": {
      "NODE_ENV": "development"
    }
  }]
}

Start!

When the web server has started successfully, you will receive a console message:

info blog started in development { address: '::', family: 'IPv6', port: 3000 }