Skip to content

Commit 8d663d4

Browse files
author
Vikas Agarwal
committed
Supporting overriding HTTP Method via X-HTTP-Method-Override header
1 parent f0bc715 commit 8d663d4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"http-aws-es": "^1.1.3",
4949
"joi": "^8.0.5",
5050
"lodash": "^4.16.4",
51+
"method-override": "^2.3.9",
5152
"pg": "^4.5.5",
5253
"pg-native": "^1.10.0",
5354
"sequelize": "^3.23.0",

src/app.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import express from 'express';
2+
import methodOverride from 'method-override'
23
import _ from 'lodash';
34
import bodyParser from 'body-parser';
45
import config from 'config';
@@ -11,6 +12,9 @@ import analytics from './events/analytics';
1112

1213
const app = express();
1314

15+
// allows overriding HTTP Method
16+
app.use(methodOverride('X-HTTP-Method-Override'))
17+
1418
// =======================
1519
// configuration =========
1620
// =======================

0 commit comments

Comments
 (0)