This section will show you how to examine the URL and take action based on the path and query string.
You may be used to thinking of the URL as naming a file on the server. With AppJet, there is only one file that always runs, and it is up to you what to do with the "path", the part of the URL after the name of the server.
You use the global variable request.path to access the
path, which always starts with a slash ("/").
This app demonstrates a basic way to serve different things based on the path.
We also provide a "dispatch" library that handles the most common
cases of dealing with the path. When you call
dispatch(), it automatically calls functions that you
name starting with "get_".
This app serves different pages to different paths using the dispatch library.