Matrix/Webserver/README.md

44 lines
1.3 KiB
Markdown
Raw Permalink Normal View History

2023-12-01 07:06:10 +00:00
## About
2023-11-23 12:22:59 +00:00
2024-03-15 08:18:35 +00:00
This is a Webserver to host a Website on the same machine as the Matrix API. It allows users to access the functions provided by the [API](../API/) and developers to implement new features and interfaces such as games as demos.
2023-11-23 12:22:59 +00:00
2024-04-04 13:25:11 +00:00
## Prerequisites
Download and install the [LTS](https://github.com/nodesource/distributions?tab=readme-ov-file#installation-instructions) release of NodeJS and NPM.
2023-12-01 07:06:10 +00:00
## Installation
2023-11-23 12:22:59 +00:00
2023-12-01 07:06:10 +00:00
1. Download repository with `git clone https://gitlab1.ptb.de/waltem01/Matrix.git`
2. Navigate to the Webserver directory with `cd Webserver/`
3. Install dependencies with `npm install`
2023-11-23 12:22:59 +00:00
2023-12-01 07:06:10 +00:00
## Development
2023-11-23 12:22:59 +00:00
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
## Building
2023-12-01 07:06:10 +00:00
To create a production version of the app:
2023-11-23 12:22:59 +00:00
```bash
npm run build
```
You can preview the production build with `npm run preview`.
2023-12-01 07:06:10 +00:00
## Running
2024-03-15 08:18:35 +00:00
1. After finishing the [build process](#Building):
2. Navigate into the production environment with `cd build/`
3. Install dependencies with `npm ci --omit dev`
4. Start the production server with `node .`
2024-01-11 12:18:48 +00:00
## Note
2024-03-15 08:18:35 +00:00
If the Matrix API is executed on a separate device, although this is explicitly advised against, you will need to point the Webserver to it by setting the optional environment variables shown in [`.env.example`](.env.example).