Node.js and Python starters
A starter is a small working app that Apps sets up for you: the code, the packages and the address. Every starter answers a health check, so you know it's running before you change anything. This article lists what each one contains.
The starters
| Starter | Runtime | Needs | Health check | Main file |
|---|---|---|---|---|
| Express | Node.js | 18 or newer | /health |
app.js |
| Fastify | Node.js | 20 or newer | /health |
app.js |
| Next.js | Node.js | 18 or newer | / |
server.js from your build |
| Flask | Python | 3.9 or newer | /health |
app.py |
| Django | Python | 3.10 or newer | /health |
config/urls.py |
| FastAPI | Python | 3.9 or newer | /health |
main.py |
| Your own code | Either | Any | / |
The file you name |
The wizard only offers starters your server has a version for, and picks the newest version by default.
What's in each one
Express and Fastify
package.jsonwith the framework.app.jswith a welcome page at/and{"ok": true}at/health.NODE_ENVset toproduction.
Next.js
Next.js has no template. You upload a standalone build, and we start its server.js without installing or building anything. See Deploy a Next.js site.
Flask
app.pywith the routes.passenger_wsgi.py, the startup file the server runs.requirements.txtwith Flask.
Django
- A project in
config/with production settings, SQLite, and the routes inconfig/urls.py. manage.pyandpassenger_wsgi.py.DJANGO_SECRET_KEY, a new random value for each app, andDJANGO_ALLOWED_HOSTS, your domain. Both live in the app's environment variables, not in the code.
FastAPI
main.pywith the routes and API docs at/docs.passenger_wsgi.py, which bridges FastAPI to the server witha2wsgi.requirements.txtwith FastAPI anda2wsgi.
Paths and APP_BASE_PATH
You can run an app on a whole domain (api.example.ca) or under a path (example.ca/orders). Under a path, we set APP_BASE_PATH to /orders. Every starter serves its routes both under that path and at /, so links work either way.
Next.js doesn't read APP_BASE_PATH. For a Next.js app under a path, set basePath: '/orders' in next.config.js before you build.
Grow it into your app
- Edit the files in the code folder with Files, SFTP or Git.
- Add packages to
package.jsonorrequirements.txt. - In Apps, open the ⋯ menu on the app and click Install packages. The install runs in the background and restarts the app when it's done.
- After code changes that need no new packages, click Restart.
Keep the health check, or change it to something that proves your app works, such as a database query. The New app drawer waits for it to return OK when you create the app. After that, the app list checks that your app's address answers each time you open Apps.
If something goes wrong
| Problem | Fix |
|---|---|
| A starter isn't in the list | Your server doesn't have a version it needs yet. Open a request and we'll check |
| "That folder already has files" | Type a new Code folder path, such as apps/orders-2, or pick Your own code to run what's there |
| The health step doesn't finish | Open Recent errors from the app's ⋯ menu |
Still stuck? Ask us and we'll walk you through it.
