Skip to content

Commit

Permalink
Server: remove bodyParser and morgan (log)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluzzi committed Aug 8, 2022
1 parent 8a0f9e3 commit 7d96fb1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"ejs": "^3.1.5",
"express": "~4.16.1",
"fs": "0.0.1-security",
"morgan": "~1.9.1",
"sass": "^1.26.10",
"sass-folder-converter": "^1.0.3"
},
Expand Down
8 changes: 0 additions & 8 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const express = require("express");
const bodyParser = require("body-parser");
const fs = require("fs");
const convertSass = require("sass-folder-converter");

Expand All @@ -9,9 +8,6 @@ convertSass(__dirname + "/public/sass/", __dirname + "/public/css/");
// Create express instance :
global.server = express();

// Setup the logger :
server.use(require("morgan")("dev"));

// Define public folder :
server.use(express.static(__dirname + "/public"));

Expand All @@ -21,10 +17,6 @@ server.set("views", __dirname + "/views");
// Setup view engine :
server.set("view engine", "ejs");

// Add body parser middleware for get body content (for post method) :
server.use(bodyParser.json()); // support json encoded bodies
server.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies

// Routes and 404 error :
fs.readdirSync(__dirname + "/routes/").forEach(fileName => require("./routes/" + fileName)); //TODO: ajout du support des sous dossier.

Expand Down

0 comments on commit 7d96fb1

Please sign in to comment.