1.8 KiB
1.8 KiB
Setup:
cdinto thiswebdirectory.- Run
pnpm installto install all of the required dependencies for the site.
Now jump to the Production or Development section and continue the steps there.
Production
- Run
pnpm buildto create the folder with all the files for the webserver. - Create a symlink pointing to the
dist/directory that was created in the last step. - Tell your favourite web server (I'd recommend nginx) for serving the files from that directory.
- In the webserver of your choice, you must also setup an
example.com/socket.ioroute 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 theserc/main.jsfile to have a specific URL and port.
Example: Change
// This is the default value that will require a
// "/socket.io" proxy in your web server.
let websocket_uri = `/`;
to:
// 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`;
- 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:
- Make sure the websocket server is started either through a terminal or
through the systemd service on port
8081for 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 insrc/main.jsto the correct port number) - Run
pnpm serve, this will start a local hot-reloading server onlocalhost:8080. DO NOT reverse-proxy this server. It serves files that are not optimized nor minified. - Go to
localhost:8080in your web browser of choice.