Documentation › Traditional web application › Routing requests
Application routes are declared in the routes() method in the cmd/web/routes.go file. This method defines how HTTP requests – matched on method and path – are mapped to your handlers.
The exact contents of routes() will vary depending on the options you selected when generating your codebase, but it will always include at least the following pre-declared routes:
| Route | Handler | Description |
|---|---|---|
GET /static/ |
fileServer |
Serves static files from the assets/static directory. |
GET / |
app.home |
Renders the home page. |
If you select the User accounts and authentication option, you'll see a number of additional pre-declared routes – these are documented here.
The syntax for adding new routes depends on which router you chose when generating your codebase. Please refer to the pre-declared routes in your cmd/web/rotues.go file for examples, and the official documentation for your chosen router for full details.