From 3cb599511ee025f9e03154401da6e96aafd29bf9 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sat, 9 Jan 2021 00:51:55 -0700 Subject: [PATCH] Change README to have proper install instructions. --- web/README.md | 55 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/web/README.md b/web/README.md index 27dd417..8976738 100644 --- a/web/README.md +++ b/web/README.md @@ -1,19 +1,44 @@ -## Project setup -``` -pnpm install -``` +# Setup: +1. `cd` into this `web` directory. +2. Run `pnpm install` to install all of the required dependencies for the site. -### Compiles and hot-reloads for development -``` -pnpm run serve -``` +Now jump to the [Production](#Production) or [Development](#Development) +section and continue the steps there. -### Compiles and minifies for production -``` -pnpm run build -``` +--- -### Lints and fixes files +## Production +3. Run `pnpm build` to create the folder with all the files for the webserver. +4. Create a symlink pointing to the `dist/` directory that was created in the +last step. +5. Tell your favourite web server (I'd recommend nginx) for serving the files +from that directory. +6. In the webserver of your choice, you must also setup an +`example.com/socket.io` route that reverse proxies the websocket connection +through to the Node.js server. If you do not want to set up this proxy, you can +bypass it by changing the URI in the `serc/main.js` file to have a specific URL and port. + +Example: Change +```js +// This is the default value that will require a +// "/socket.io" proxy in your web server. +let websocket_uri = `/`; ``` -pnpm run lint -``` \ No newline at end of file +to: +```js +// this is the specific domain and port to connect to, as an example on how to +// bypass setting up a reverse proxy. +let websocket_uri = `http://example.com:1234`; +``` +7. Once the reverse proxy or specific URI is setup, connect to your website through the appropriate domain and check to see if it worked. + + +## Development: +3. Make sure the websocket server is started either through a terminal or +through the systemd service on port `8081` for local development. (if you want +to connect to a websocket server that is not on port 8081 for development, you +will need to change the port value in `src/main.js` to the correct port number) +4. Run `pnpm serve`, this will start a local hot-reloading server on +`localhost:8080`. **DO NOT** reverse-proxy this server. It serves files that +are not optimized nor minified. +5. Go to `localhost:8080` in your web browser of choice. \ No newline at end of file