This is the backend web project that supports the GMod Express Addon.
It's super straightforward to run your own Express instance on Cloudflare!
It should only take a couple of minutes, just click this button! (more instructions below):
The Express Service comes out-of-the-box ready to self-host.
The included docker-compose.yml
has everything you need to get started. All you need is Docker Compose.
Once you clone the repository, you just start it with Compose:
docker compose up --build -d
The Express Service will (by default) be available at both 127.0.0.1:3000
and your public IP, port 3000.
You can change the address that Express binds to by changing the API_HOST
/API_PORT
settings in the .env
file.
For example, if you were going to serve Express from behind a Reverse Proxy, you might want to set API_HOST=127.0.0.1
.
If you host your own Express instance, you'll need to change a couple of convars.
This convar tells both the Server and Client what domain they can find Express at. By default, it's gmod.express
- the public & free Express instance.
If you run Express from Cloudflare, you'll need to update this convar with whatever your Cloudflare Worker URL is.
By default it's a *.workers.dev
domain, but if you configure it to use one of your domains, you'll of course want to set that instead.
This convar lets you set a specific domains for Clients. If you leave it empty, both Server and Client will use express_domain
.
This convar is useful if you self-host Express on the same machine that runs your Garry's Mod server. In that setup, you'll want to do something like this:
# Tell the server to find Express locally
# (me.cfc.gg redirects to 127.0.0.1 to get around Gmod's localhost HTTP restrictions)
express_domain "me.cfc.gg:3000"
# Tell the clients to find it at your server's public IP (or, ideally, HTTPS-ready Domain)
express_domain_cl "23.227.174.90:3000"
If you host on Cloudflare, you should leave this convar empty (express_domain_cl ""
)