stubby-simply
v0.2.8
Published
Stubby with simple configuration and multiples mocks files instead of 1 file
Downloads
2
Maintainers
Readme
stubby-simply
Install
npm install stubby-simply --save-dev
npm install npm-run-all --save
Configure your package.json
Api redirect conf
If you use Create-react-app
Add this in your package.json
:
"proxy": {
"/api/": {
"target": "http://localhost:8882",
"ws": true,
"autoRewrite": true,
"hostRewrite": true
}
},
All calls on /api/ will be redirect to the stubby server default config.
Npm scripts
Add rename some scripts in the npm scripts part in package.json
"scripts": {
- "start": "react-scripts start",
+ "start-js": "react-scripts start",
+ "start": "npm-run-all -p stubby start-js",
+ "stubby": "stubby-simply --mocks mocks",
}
Beware about the -p
it is used to launch all scripts in parallel
Contribution
Contribution documentation can be found in contributing file.