30 lines
832 B
JavaScript
30 lines
832 B
JavaScript
const express = require('express');
|
|
const session = require('express-session');
|
|
const router = require('express').Router();
|
|
const path = require('path');
|
|
|
|
require('dotenv').config({path:'process.env'});
|
|
|
|
const app = express();
|
|
|
|
app.use(session({
|
|
secret: 'secret',
|
|
resave: true,
|
|
saveUninitialized: true
|
|
}));
|
|
|
|
app.use(express.json());
|
|
app.use(express.urlencoded({ extended: true }));
|
|
app.use(express.static(path.join(__dirname, '/scripts')));
|
|
app.use(express.static(path.join(__dirname, '/static')));
|
|
|
|
const getIndexRoute = require('./scripts/routes/other/route-index');
|
|
|
|
app.use('/', getIndexRoute);
|
|
|
|
app.listen(process.env.APP_PORT, () => {
|
|
console.log("\x1b[32m");
|
|
console.log(`Server is running on http://localhost:${process.env.APP_PORT}`);
|
|
console.log("\x1b[0m");
|
|
console.log('Access it now...');
|
|
}); |