Skip to content

Commit 0f0070b

Browse files
author
vikasrohit
authored
Merge pull request #56 from topcoder-platform/dev
Release to allow Method Override Header
2 parents 2625491 + b6998cf commit 0f0070b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-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: 6 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,11 @@ import analytics from './events/analytics';
1112

1213
const app = express();
1314

15+
// allows overriding HTTP Method
16+
// both arguments to the methodOverride are optional because they are the default
17+
// values, but we are specifying them to avoid any future change in defaults
18+
app.use(methodOverride('X-HTTP-Method-Override', { methods: ['POST'] }));
19+
1420
// =======================
1521
// configuration =========
1622
// =======================

0 commit comments

Comments
 (0)