Giter Club home page Giter Club logo

mockjs-webpack-plugin's People

Contributors

soon08 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

wwwk

mockjs-webpack-plugin's Issues

模拟接口请求的时候遇到了 504 报错

环境描述:

macOS: 10.12.6
node: v8.7.0
npm: 5.7.1
webpack: ^4.1.1

代码目录结构大概是:

├── dist
├── config
├── src
├── webpack.config.js
├── mock    //mock data folder
⎪   ├── data.js
⎪   ├── data.json

接口报错 504 Gateway Timeout

出错提示显示 from localhost:9000 to http://localhost: 3000/ (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)

关于post的支持和js文件加载失败

  1. 好像看server文件中对于app没有使用express.json和esxpress.urlencoded进行post等请求没法正确解析请求体中携带参数。
  2. 目前没找到问题,当使用.js文件进行载入时,require会报错.

TypeError: Cannot read property 'loaded' of null
at Function.Module._load (internal/modules/cjs/loader.js:751:23)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at D:\frontend_project\fed.m-change\node_modules_mockjs-webpack-plugin@3.0.1@mockjs-webpack-plugin\src\routes.js:65:20
at Layer.handle [as handle_request] (D:\frontend_project\fed.m-change\node_modules_express@4.17.1@express\lib\router\layer.js:95:5)
at trim_prefix (D:\frontend_project\fed.m-change\node_modules_express@4.17.1@express\lib\router\index.js:317:13)
at D:\frontend_project\fed.m-change\node_modules_express@4.17.1@express\lib\router\index.js:284:7
at Function.process_params (D:\frontend_project\fed.m-change\node_modules_express@4.17.1@express\lib\router\index.js:335:12)
at next (D:\frontend_project\fed.m-change\node_modules_express@4.17.1@express\lib\router\index.js:275:10)
at urlencodedParser (D:\frontend_project\fed.m-change\node_modules_body-parser@1.19.0@body-parser\lib\types\urlencoded.js:82:7)
at Layer.handle [as handle_request] (D:\frontend_project\fed.m-change\node_modules_express@4.17.1@express\lib\router\layer.js:95:5)
at trim_prefix (D:\frontend_project\fed.m-change\node_modules_express@4.17.1@express\lib\router\index.js:317:13)
at D:\frontend_project\fed.m-change\node_modules_express@4.17.1@express\lib\router\index.js:284:7
at Function.process_params (D:\frontend_project\fed.m-change\node_modules_express@4.17.1@express\lib\router\index.js:335:12)
at next (D:\frontend_project\fed.m-change\node_modules_express@4.17.1@express\lib\router\index.js:275:10)
at D:\frontend_project\fed.m-change\node_modules_body-parser@1.19.0@body-parser\lib\read.js:130:5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.