a kart racing game created with three.js and cannon-es, based on the playground-kart
the backend is written in http, if you want https i recommand to reverse proxy for that.
if you want to run as development
in root folder create .env
file with this variables
PORT=<your desired port>
ORIGIN=<theres no default value, for developement put the value of '*'>
in src folder create config.ts
file with this variables
export default {
BASE_URL: "<ip>:<port>", // its important that its will not end with /
PATH: "",
WEBSOCKET_PROTOCOL: "ws", // "ws" | "wss"
HTTP_PROTOCOL: "http", // "http" | "https"
};
if you want to run as production with domain
in root folder create .env
file with this variables
PORT=<your desired port>
ORIGIN=<theres no default value, for developement put the value of '*'>
in src folder create config.ts
file with this variables
export default {
BASE_URL: "<domain>", // its important that its will not end with /
PATH: "",
WEBSOCKET_PROTOCOL: "ws", // "ws" | "wss"
HTTP_PROTOCOL: "http", // "http" | "https"
};
if you want to run as production with domain and you need sub path
in root folder create .env
file with this variables
PORT=<your desired port>
ORIGIN=<theres no default value, for developement put the value of '*'>
SUBPATH=/<path> # its important that its start with /
in src folder create config.ts
file with this variables
export default {
BASE_URL: "<domain>", // its important that its will not end with /
PATH: "/<path>", // its important that its will start with /
WEBSOCKET_PROTOCOL: "ws", // "ws" | "wss"
HTTP_PROTOCOL: "http", // "http" | "https"
};