An open API service indexing awesome lists of open source software.

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

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