A multiplayer typeracing game.
npm start
The process will launch a HTTP server at localhost which will serve the following (relative) urls:
- / - The root folder will serve the game client
- /admin - The server control panel. This requires authentication.
The following environment variables can be configured:
- PORT - Listening port. Default 5000.
- TOS_SERVER_AUTH - HTTP Basic Authentication header to access the server control panel. Default is username = "admin", password = "admin".
npm run build
or tsc
.
Texts for the game are stored in the file /data/texts.json. This file can be regenerated by launching the command npm run generate-texts
. This script will scan the /data_sources folder for text (*.txt) files. If you want to know how the text are extracted you can take a look at the source file /src/util/generate-texts.ts.
Nothing special about deployment, you can simply clone this repository on the target machine and npm install && npm build
.
Remember to configure your environment variables and also, if you have your own version of the client, make sure to replace the content of the /client folder. Note that this is not mandatory, as you may serve the client code from another host.
- / - project root
- src - source TypeScript files
- build - TypeScript compiler output
- data - Assets
- data_sources - Resources to generate assets
- views - EJS views
- client - Root folder of the client
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.