Different startup-url / additional URL param after "preside start" command?

hello guys! i’m using a shellscript to update my presidemcs based sites in the following way:

# commandbox path commandBoxPath="/opt/homebrew/Cellar/commandbox/6.1.0/bin/box" 

# start presidecms site and install the specified version 
"$commandBoxPath" "preside start" 
"$commandBoxPath" "install presidecms@v$version"

is there any option to change the startup-url which is opended in the browser with a full coldbox framework reinit?

i’d like to request localhost:[port]/index.cfm?fwreinit=true instead of localhost:[port]/index.cfm if possible

Hi Marcus,

preside start executes server start with a couple of additional settings. So basically you can do anything that server start would accept.

I can think of two possible ways:
a) via command line, something like this
"$commandBoxPath" "server set openBrowserURL='/?fwreinit=true'"

See: Embedded Server | CommandBox : CLI, Package Manager, REPL & More
This example doesn’t use quotes around the URL, so maybe you have to escape the equal sign (and possibly the question mark) instead

b) put the URL in server.json:

{
    "openBrowserURL": "http://mydomain:myport/?fwreinit=true",
}

See Server.json | CommandBox : CLI, Package Manager, REPL & More

For what it’s worth, I tried doing a reinit via a curl command, but for some reason that does not do a full reload. :frowning:

HTH,

Chris

1 Like

Hi Chris!

Thanks so much, i had something like this in mind but i didn’t find the openBrowserURL option :slight_smile:
again: thanks for the reference, very useful for me!
Cheers, Marcus

This is a startup command I’ve used for one of my sites locally:

preside start port=8100 host=hambledon.cc.local

Note that once you’ve run that once, it should remember the settings and you’ll be able to start up next timw with just preside start

1 Like

Having said that, I see no advantage in adding the reinit parameter to the startup URL. All that fwreinit=true does is reload the application in the same way it does when first started up anyway…

1 Like

Final point. Looking at the script in your initial post, you’d probably be better doing the install before starting the site.

2 Likes

I would also install first and then start preside.

What you can do in your script ist just doing a curl or wget to a page. This should do it.

Best
Michi

1 Like

thank you, yes that makes much more sense. my updated version of the script is fine now :slight_smile: but the openBrowserURL option Chris mentioned is a good option to have

thanks Michi, you’re right regarding the order, too (as Seb) :slight_smile:
if you do need a different startup url i find the openBrowserURL option is a solid choice