require('dotenv').config(); var express = require('express'); var bodyparser = require('body-parser'); var mysql = require('mysql'); var cookieParser = require('cookie-parser'); var expsession = require('express-session'); var app = express(); //included files var connect= require('./lib/db'); var indexRouter= require('./routes/api'); //use method app.use(bodyparser.json()); app.use('/',indexRouter); app.use(cookieParser()); app.use(expsession({ secret: '34SDgsdgspxxxxxxxdfsG', // just a long random string resave: false, saveUninitialized: true }));