Am a newbie here. I want to develop a NodeJS application which serves only to expose REST APIs. My application have nothing to do with View. I used Express generator to generate a project and I removed the views folder. Also I changed the package.json 'start' from 'node bin/www' to 'node app.js'. But it didn't worked.
How can I structure my project so that it will initialise with routes and my APIs will be exposed.
I got a suggestion to use 'Swagger', but I need to work with .yaml file and didn't want my team to do considering future dependencies. Thanks for the help in advance.
app.js
var express = require('express');
var bodyParser = require('body-parser');
var contoller = require('./domains/apply/controller');
var app = express();
app.use(bodyParser.json());
console.log(req.body.address);
res.json({ ok: true });
});
controller.js
app.get('/employee', function(req, res){
"use strict";
console.log(" employee ---- "+req);
res.json({ ok: true });
});