Skip to content

Commit

Permalink
feat: 增加 body-parser
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongzhi107 committed Dec 9, 2019
1 parent 17e8e5f commit 0172f93
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 29 deletions.
154 changes: 125 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"axios": "^0.19.0",
"babel-loader": "^8.0.6",
"babel-preset-dace": "^2.1.0",
"body-parser": "^1.19.0",
"chalk": "^2.4.1",
"clean-webpack-plugin": "^3.0.0",
"commander": "^2.20.0",
Expand Down
2 changes: 2 additions & 0 deletions src/runtime/createServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Helmet } from 'react-helmet';
import serialize from 'serialize-javascript';
import { RedBoxError } from 'redbox-react';
import cookieParser from 'cookie-parser';
import bodyParser from 'body-parser';
import NotFound from './components/NotFound';
import addProxy from './utils/addProxy';
import addStatic from './utils/addStatic';
Expand All @@ -24,6 +25,7 @@ addStatic(server);

server
.disable('x-powered-by')
.use(bodyParser())
// 解析 cookie
.use(cookieParser())
.all('*', async (req, res) => {
Expand Down

0 comments on commit 0172f93

Please sign in to comment.