App URLs
There are essentially 3 different URLs you can use to access an App:- The official app URL:
- The “static” internal app URL:
- The current session URL:
Using parameters in URLs
What if you want to use a parameter in your URL? For example, what if you want your landing page to be- The official app URL will not ever change for an app. Currently, you can’t append a parameter to it, as it just gets ignored/thrown out.
- The “static” internal app UR: will not change if you stop and start the app, but it will change if you rename the project or change ownership. Currently, you can’t append a parameter to it, as it just gets ignored/thrown out. Going to this URL in a browser immediately redirects to the next URL, your app without the Domino banner:
- The current session URL will change every time you start and stop the app. You can append parameters or paths to other pages and the app will parse them.
Example App with URL parameters
As we see above, there is a URL we can use for our App where we can append URL parameters. Great! But this URL is going to change any time the App is stopped/restarted. One way to address this is to make your initial app page a landing page, which can add your parameters before going to your main app page, or, if appropriate, prompt your app user for the parameters. Let’s look at a couple of examples! For both Apps, we will use the same app.sh and app.py: app.sh:<your-domino-url>/modelproducts/<app\_id>) will automatically go to appPage.html.
The “static” internal app URL (http://<your-domino-url>/u/<user>/<project>/app) will automatically redirect to the current session URL and append the parameters: http://<your-domino-url>/<user>/<project>/r/notebookSession/<session\_id>appPage.html?name=Domino&period=day
Example App #2
For our second example, we’ll actually prompt the user for some input.
Index.html:
<your-domino-url>/modelproducts/<app\_id>) will automatically go to appPage.html.
The “static” internal app URL (http://<your-domino-url>/u/<user>/<project>/app) will automatically redirect to the current session URL and append the parameters: http://<your-domino-url>/<user>/<project>/r/notebookSession/<session\_id>appPage.html?name=Domino&period=day