Commit 06133cd96c9dba5b479dd63ca19fc29cd69cb6d7
1 parent
abef83aa
Suppression des dépendances non-nécessaires
À suivre bêtement les tutos...
Showing
2 changed files
with
1 additions
and
9 deletions
Show diff stats
package.json
@@ -7,9 +7,7 @@ | @@ -7,9 +7,7 @@ | ||
7 | "body-parser": "^1.12.2", | 7 | "body-parser": "^1.12.2", |
8 | "cookie-parser": "^1.3.4", | 8 | "cookie-parser": "^1.3.4", |
9 | "express": "^4.12.3", | 9 | "express": "^4.12.3", |
10 | - "method-override": "^2.3.2", | ||
11 | "mongoose": "^4.0.1", | 10 | "mongoose": "^4.0.1", |
12 | - "morgan": "^1.5.2", | ||
13 | "node-line-reader": "0.0.2", | 11 | "node-line-reader": "0.0.2", |
14 | "ssh2": "^0.4.6", | 12 | "ssh2": "^0.4.6", |
15 | "ursa": "^0.8.4" | 13 | "ursa": "^0.8.4" |
server.js
1 | // Modules ==================================================================== | 1 | // Modules ==================================================================== |
2 | var express = require('express'); | 2 | var express = require('express'); |
3 | -var app = express(); | ||
4 | var mongoose = require('mongoose'); | 3 | var mongoose = require('mongoose'); |
5 | -var morgan = require('morgan'); | ||
6 | var bodyParser = require('body-parser'); | 4 | var bodyParser = require('body-parser'); |
7 | -var methodOverride = require('method-override'); | ||
8 | var cookieParser = require('cookie-parser'); | 5 | var cookieParser = require('cookie-parser'); |
9 | 6 | ||
10 | // Application ================================================================ | 7 | // Application ================================================================ |
11 | 8 | ||
9 | +var app = express(); | ||
12 | var config = require('./config/config.js'); | 10 | var config = require('./config/config.js'); |
13 | var port = process.env.PORT || config.port; | 11 | var port = process.env.PORT || config.port; |
14 | 12 | ||
@@ -18,13 +16,9 @@ mongoose.connect(db.url); | @@ -18,13 +16,9 @@ mongoose.connect(db.url); | ||
18 | 16 | ||
19 | // Tricks | 17 | // Tricks |
20 | app.use(bodyParser.json()); | 18 | app.use(bodyParser.json()); |
21 | -app.use(bodyParser.json({ | ||
22 | - type: 'application/vnd.api+json' | ||
23 | -})); | ||
24 | app.use(bodyParser.urlencoded({ | 19 | app.use(bodyParser.urlencoded({ |
25 | extended: true | 20 | extended: true |
26 | })); | 21 | })); |
27 | -app.use(methodOverride('X-HTTP-Method-Override')); | ||
28 | 22 | ||
29 | // Cookie-parser | 23 | // Cookie-parser |
30 | app.use(cookieParser()); | 24 | app.use(cookieParser()); |