text: var express = require('express'),
      bodyParser = require('body-parser'),
      app = express(),
      port = process.env.PORT || 3000;
  
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({
      extended:true,
  }));
  
  app.use(function (req, res, next) {
      res.setHeader('Access-Control-Allow-Origin', '*');
      res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, UPDATE, PATCH');
      res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
      res.setHeader('Access-Control-Allow-Credentials', true);
      next();
  });
  
  app.get('/', (req, res) => {
      return res.send({error: true, message: 'Unexpected access reached'});
  });
  
  var routes = require('./api/routes/apiRoutes');
  routes(app);
  
  app.listen(port, () => {
      console.log(`Api server started on: ${port}`);
  });
  
  module.exports = app;