2015-09-02 16:33:31 -04:00
## scratch-www
#### Standalone web client for Scratch
2015-09-02 15:08:58 -04:00
2015-09-02 15:11:22 -04:00
[![Build Status ](https://magnum.travis-ci.com/LLK/scratch-www.svg?token=xzzHj4ct3SyBTpeqxnx1 )](https://magnum.travis-ci.com/LLK/scratch-www)
2015-09-02 15:08:58 -04:00
### To Build
```bash
2015-09-02 16:45:58 -04:00
npm install
2015-09-04 01:26:56 -04:00
npm run build
```
### To Run
```bash
2015-09-02 15:08:58 -04:00
npm start
```
2015-11-19 15:59:30 -05:00
During development, `npm start` watches any update you make to files in either `./static` or `./src` and triggers a rebuild of the project. In development the build is stored in memory, and not served from the `./build` directory.
2015-10-09 12:57:10 -04:00
2015-09-16 10:40:03 -04:00
Once running, open `http://localhost:8333` in your browser. If you wish to have the server reload automatically, you can install either [nodemon ](https://github.com/remy/nodemon ) or [forever ](https://github.com/foreverjs/forever ).
2015-09-02 17:59:31 -04:00
2015-10-09 12:57:10 -04:00
### To stop
2015-11-19 15:59:30 -05:00
Use `^C` to stop the node process `npm start` starts.
2015-10-09 12:57:10 -04:00
2015-10-07 11:48:18 -04:00
#### Configuration
2015-11-19 15:59:30 -05:00
`npm start` can be configured with the following environment variables
2015-10-07 11:48:18 -04:00
2015-10-07 16:15:10 -04:00
| Variable | Default | Description |
| ------------- | ------------------------------------- | ---------------------------------------------- |
2015-11-03 10:44:56 -05:00
| `API_HOST` | `https://api.scratch.mit.edu` | Hostname for API requests |
2015-10-07 16:15:10 -04:00
| `NODE_ENV` | `null` | If not `production` , app acts like development |
| `PORT` | `8333` | Port for devserver (http://localhost:XXXX) |
2015-12-03 10:41:02 -05:00
| `FALLBACK` | `false` | Whether or not to fallback to `PROXY_HOST` for non-existent pages/reqeusts |
2015-11-03 10:44:56 -05:00
| `PROXY_HOST` | `https://scratch.mit.edu` | Pass-through location for scratchr2 |
2015-10-07 11:48:18 -04:00
2015-12-03 10:41:02 -05:00
#### Current issues with the development
* Login does not work (*In the process of being fixed*)
2015-09-02 15:08:58 -04:00
### To Test
```bash
npm test
```