Edit Fork Copy var token= "abcdefgh" var express= require("express"); var app= express(); app.listen(3000); var bodyParser= require('body-parser'); var jsonParser = bodyParser.json() var urlencodedParser = bodyParser.urlencoded({ extended: false }); var mvc= require('./mvc.js'); var demo= mvc.MVC(); app.use(bodyParser.json({ type: 'application/*+json' })); app.post("/authorize", urlencodedParser , function(req, res){ var email= req.body.email; var password= req.body.password; if(!email){ res.status(404).json({status:'ko', message:'invalid'}); } else{ res.send(demo.selected); } })