Backend/index.js
2021-12-31 15:03:23 +05:30

25 lines
587 B
JavaScript

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
}));