Documentation › JSON API › Routing requests
Application routes are declared in the routes() method in the cmd/api/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 route:
| Route | Handler | Description |
|---|---|---|
GET /status |
app.status |
Returns a {"Status": "OK"} JSON response and 200 OK status code. |
If you select the User accounts and authentication option, you'll see a number of additional pre-declared routes.
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/api/rotues.go file for examples, and the official documentation for your chosen router for full details.