Backend/index.js
2022-01-13 19:22:20 +05:30

26 lines
615 B
JavaScript

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