bockensm
02/28/2022, 5:02 PMwebsites
<http://website1.com|website1.com>
app
<http://website2.com|website2.com>
app
bockensm
02/28/2022, 5:03 PMserver start name=<http://website2.com|website2.com>
from the "app" folder there but it fails to find server.json, which makes sense because that's how the docs say it will workbockensm
02/28/2022, 5:04 PMthisOldDave
02/28/2022, 5:10 PMname
element in server.json, and use an env var to set it something like { "name": "${SITE_NAME} }
bdw429s
02/28/2022, 6:51 PMIs it possible to have a CommandBox server with a name derived not from the current folder but from a parent?@bockensm Yes, write a custom module that listens to the
preServerStart
interception point and manually overrides the interceptData.serverDetails.defaultName
to override the default name on first server start.bdw429s
02/28/2022, 6:52 PMserver.json
or pass it in your server start
command. Just keep in mind, a server's name is immutable once the server starts at least once, so trying to change it after the fact will probably just create a duplicate server. Make sure you have the name specified from the very first startbdw429s
02/28/2022, 6:55 PMtriedTo be clear, this should still work. I just tested with these commands and it names the server as I requested AND uses myfrom the "app" folder there but it fails to find server.jsonserver start name=<http://website2.com|website2.com>
server.json
file
mkdir servernametest --cd
server set web.HTTP.port=1234
start name=nametestfoobar serverConfigFile=server.json --verbose
bdw429s
02/28/2022, 6:57 PMname
property inside your server.json
will also work too
server set name=nametestfoobar
server start --verbose
bdw429s
02/28/2022, 6:57 PMbockensm
02/28/2022, 7:14 PMserverConfigFile
so that's why it didn't find the configbockensm
02/28/2022, 7:15 PM