File tree 2 files changed +2
-4
lines changed
2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change 53
53
"babel-eslint" : " ^10.1.0" ,
54
54
"babel-loader" : " ^8.2.2" ,
55
55
"babel-plugin-import" : " ^1.13.3" ,
56
- "body-parser" : " ^1.19.0" ,
57
56
"clean-webpack-plugin" : " ^3.0.0" ,
58
57
"copy-webpack-plugin" : " ^9.0.1" ,
59
58
"css-loader" : " ^6.0.0" ,
Original file line number Diff line number Diff line change 1
1
/** 用于开发环境的服务启动 **/
2
2
const path = require ( "path" ) ; // 获取绝对路径有用
3
3
const express = require ( "express" ) ; // express服务器端框架
4
- const bodyParser = require ( "body-parser" ) ;
5
4
const env = process . env . NODE_ENV ; // 模式(dev开发环境,production生产环境)
6
5
const webpack = require ( "webpack" ) ; // webpack核心
7
6
const webpackDevMiddleware = require ( "webpack-dev-middleware" ) ; // webpack服务器
@@ -14,8 +13,8 @@ const app = express(); // 实例化express服务
14
13
const DIST_DIR = webpackConfig . output . path ; // webpack配置中设置的文件输出路径,所有文件存放在内存中
15
14
let PORT = 8888 ; // 服务启动端口号
16
15
17
- app . use ( bodyParser . urlencoded ( { extended : false } ) ) ;
18
- app . use ( bodyParser . json ( ) ) ;
16
+ app . use ( express . urlencoded ( { extended : false } ) ) ;
17
+ app . use ( express . json ( ) ) ;
19
18
20
19
/** 监听POST请求,返回MOCK模拟数据 **/
21
20
app . post ( / \/ a p i .* / , ( req , res , next ) => {
You can’t perform that action at this time.
0 commit comments