gaws
v0.0.12
Published
Give-me a Web Server
Downloads
3
Readme
gaws
Easy to use dev content-server while developing UI.
This is probably the worst possible acronym. But sometimes we need a server after the command create-react-app ...
gaws = Give me a Web Server I can configure using package.json
Install
yarn add gaws -D
Setup your package.json
Edit your package.json
like this to define routes, port and proxy:
{
"name": "your-react-project-name",
"version": "0.0.1",
"private": true,
"dependencies": {
"react": "^15.5.4",
"react-dom": "^15.5.4"
},
"devDependencies": {
"gaws": "^0.0.6",
"react-scripts": "0.9.5"
},
"scripts": {
"start-server": "gaws",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"gaws" : {
"port": 3001,
"routes": [
["get", "/customers", "./mock/customers.json", "text/json"],
["post", "/customers", "./mock/new-customer.json", "text/json"],
["get", "/customers-legacy", "./mock/customers.xml", "text/xml"],
]
},
"scripts": {
"start-server": "gaws"
},
"proxy": "http://localhost:3001/",
}