A barebones Node.js app using Express and EJS templates, ready to deploy to Build.
Use it as a starting point for your own app, or as a sandbox to learn the Build deployment workflow: buildpacks, Procfiles, config vars, and automatic deploys.
.
├── Procfile # Tells Build how to start the web process
├── server.js # Express app — routes and API endpoints
├── views/index.ejs # Landing page template
├── public/css/ # Static assets
├── .env.example # Sample local config (copy to .env)
└── Dockerfile # Optional: for the "dockerfile" stack
You'll need Node.js 22 or later.
git clone https://github.com/<your-org>/node-getting-started.git
cd node-getting-started
npm install
cp .env.example .env
npm run devOpen http://localhost:3000. The dev script restarts the server when you edit files.
Build deploys directly from GitHub, so first push this repository to your account:
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/<you>/node-getting-started.git
git push -u origin mainThen, in the Build dashboard:
- Create an app — click New + → New App, give it a name, and pick a region.
- Check the stack — in Settings, the default stack with the Node.js buildpack auto-detected from
package.jsonworks out of the box. (Optionally addhttps://github.com/heroku/heroku-buildpack-nodejsexplicitly.) - Connect GitHub — in Deploy → Connection, select your organisation and connect this repository.
- Deploy — in Deploy → Manual Deploy, choose
mainand click Deploy Branch. Watch the build run, then click Go on the Overview tab to open your live app.
For continuous deployment, enable Automatic Deploys on the Deploy tab — every push to main then triggers a new build.
The landing page greeting is read from the GREETING environment variable. Change it with the Build CLI — no redeploy needed:
brew install buildio/cli/bld
bld login
bld config:set GREETING="こんにちは, Build!" -a <your-app>Refresh the page or hit the API:
curl https://<your-app>.build.io/api/greeting- Procfile — declares the web process:
web: npm start. Build's router sends HTTP traffic only towebprocesses. $PORT— Build injects the port at runtime;server.jsreadsprocess.env.PORT. Never hardcode a port.- Config vars — settings live in the environment, not in code (twelve-factor style). Locally,
dotenvloads them from.env, which stays out of git.
Prefer Docker? A Dockerfile is included. In Settings → Stack, select dockerfile, then deploy as normal — Build builds the image and runs it instead of using buildpacks.
| Path | Description |
|---|---|
/ |
Landing page with runtime info |
/api/status |
JSON health/uptime endpoint |
/api/greeting |
Returns the GREETING config var |
- Uncomment the sample route at the bottom of
server.jsand redeploy. - Add a
worker:process to the Procfile for background jobs. - Attach a database from the dashboard — see Databases & Add-ons.