maxmalov / starter-kit-express

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Starter Kit

Build StatusdependenciesdevDependencies

Commands

  • npm start will start server at 3001 port
  • npm test will run project tests

API Concepts

Controllers

Each endpoints controller should have a setup function, which is responsible for routing for such specific controller, for ex.

// controllers/my-controller.js

function pong(req, res) {
  res.set({ 'Content-Type': 'text/plain' });
  res.end('pong');
}

module.exports = {
  
  pong,
  
  // draw all controller specific routes here
  setup(router) {
    router.get('/ping', pong)
  }
  
};

About


Languages

Language:JavaScript 100.0%