Commit 3272034b authored by Matthieu - Greep's avatar Matthieu - Greep

Add cookie-parser, morgan, eslint

parent 61714741
require('./socket');
require('dotenv').config();
const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
const mysql = require('mysql');
const events = require('./events');
const express = require('express'),
cors = require('cors'),
logger = require('morgan'),
cookieParser = require('cookie-parser'),
mysql = require('mysql'),
//events = require('./events'),
path = require('path'),
fs = require('fs');
const connection = mysql.createConnection({
host : process.env.DB_HOST,
port : process.env.DB_PORT,
......@@ -20,9 +23,11 @@ connection.connect();
const port = process.env.PORT || 8080;
const app = express()
.disable('etag')
.use(cors())
.use(bodyParser.json())
.use(events(connection));
.use(express.json())
.use(cookieParser())
.use(logger('(:date) :method :url - ":user-agent" (:remote-addr) - :status :response-time ms'));
app.listen(port, () => {
console.log(`Express server listening on port ${port}`);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -13,12 +13,15 @@
"license": "ISC",
"dependencies": {
"axios": "^0.21.1",
"cookie-parser": "^1.4.5",
"cors": "^2.8.5",
"dotenv": "^10.0.0",
"express": "^4.17.1",
"morgan": "^1.10.0",
"mysql": "^2.18.1"
},
"devDependencies": {
"eslint": "^7.32.0",
"nodemon": "^2.0.7"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment