Packaging Your Server
server.jsonallows you to package up an app that requires special start settings such as rewrites, JVM args, or heap size, and anyone can run it with the same settings you do by simply typing
server start. Make sure to not deploy the
server.jsonfile to your production server where it may be web-accessible.
To help with this, you can store your
server.jsonfile outside of the web root and use the
web.webrootproperty in it to point to the location of the web root. This can be an absolute path or a relative path to the location of the JSON file.
server set web.webroot=www
When you start the server, you can run the
startcommand from the same directory that the
server.jsonfile lives, or specifiy the path to the JSON file like so:
If there is no web root in your
server.json, CommandBox will use the folder that the JSON file is stored in. If there is no JSON file at all, the current working directory is used.