https://github.com/ewgenius/cra-server
simple http server with proxy for create-react-app projects
https://github.com/ewgenius/cra-server
create-react-app express proxy server
Last synced: 1 day ago
JSON representation
simple http server with proxy for create-react-app projects
- Host: GitHub
- URL: https://github.com/ewgenius/cra-server
- Owner: ewgenius
- Created: 2017-02-22T07:29:36.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-22T10:11:11.000Z (over 9 years ago)
- Last Synced: 2025-03-14T19:16:20.349Z (over 1 year ago)
- Topics: create-react-app, express, proxy, server
- Language: JavaScript
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CRA Server
Simple express static server with opt-in proxy.
## How to
```
npm install --save-dev cra-server
```
add in yout package.json:
```
...
"scripts": {
...
"serve": "cra-server"
...
}
```
use env variables
```
PORT=3000
STATIC_DIR=build
PROXY_PREFIX=/api
PROXY_URL=http://
```
or as cli tool
```
cra-server -p 3000 -d ./build
```
- -p, --port - specify port, by default is 3000
- -d, --dir - by default is ./build
- -url, --proxy-url - specify proxy url', optional
- -prefix, --proxy-prefix - specify proxy prefix, optional