From ccd4fc35f8304b76e356558238aaf2922a02096f Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Mon, 12 Feb 2024 17:41:59 +0100 Subject: [PATCH] Better instructions when building the release build --- BUILD.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index 914e6f0..59fe2f3 100644 --- a/BUILD.md +++ b/BUILD.md @@ -24,7 +24,7 @@ make run The server will be running on `localhost:8080`. This server does not hot reload, so you will need to restart the server after making changes. Note that without the frontend, the server will **NOT BE SERVING ANY HTML AND RESPOND WITH 404**. -The server works by serving the frontend as static files and providing an API for the frontend to communicate with, but when running the server, the frontend is not built. To build the frontend, you need to navigate to the frontend directory and run `npm run build`. This will create a static bundle in the `frontend/dist` directory, which the server can serve. The `frontend/dist` will have to be moved/renamed to `backend/static` for the full application to work. These steps are automated when building the final release container. +The server works by serving the frontend as static files and providing an API for the frontend to communicate with, but when running the server, the frontend is not built. To build it, refer to the [frontend section](#building-for-production). If you ever wonder what the makefile does, you can always inspect it. It's quite simple and self-explanatory. @@ -39,6 +39,10 @@ The frontend is built using Vite with React. Vite can initially seem like a conv First, you need to pull in the dependencies by running `npm install` in the frontend directory. To spin up the development server, run `npm run dev`. This will start the development server on `localhost:3000`. Note that the backend server should be running for the frontend to work. +### Building for Production + +To **build** the frontend, resulting in a static bundle, you need to navigate to the frontend directory and run `npm run build`. This will create a static bundle in the `frontend/dist` directory, which the server can serve. The `frontend/dist` will have to be moved/renamed to `backend/static` for the full application to work. These steps are automated when building the final release container. + ## Release Builds The release build for the backend is a simple binary that can be run on any machine. The release build for the frontend is a static bundle that can be served by any web server.