From 680f9a0b5c36d0ee459526a36419c5a5afd7b1e0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 12 Feb 2017 02:18:58 +0900 Subject: [Server] text/plainの場合もJSONとして解析するように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/server.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/api/server.ts') diff --git a/src/api/server.ts b/src/api/server.ts index 75f9943ee7..390032f9a4 100644 --- a/src/api/server.ts +++ b/src/api/server.ts @@ -18,7 +18,9 @@ const app = express(); app.disable('x-powered-by'); app.set('etag', false); app.use(bodyParser.urlencoded({ extended: true })); -app.use(bodyParser.json()); +app.use(bodyParser.json({ + type: ['application/json', 'text/plain'] +})); app.use(cors({ origin: true })); -- cgit v1.2.3-freya