Node.js
Any project with a package.json is detected as Node.js. gy infers your start command and
port automatically.
Deploy
Section titled “Deploy”cd my-node-appgy deployDetected automatically
Section titled “Detected automatically”- Package manager — npm, yarn, or pnpm lockfiles
- Port — from
PORTenv, thestartscript, or common defaults - Start command — your
startscript
Examples
Section titled “Examples”Express
Section titled “Express”const express = require('express');const app = express();const port = process.env.PORT || 3000;
app.get('/', (req, res) => res.send('Hello from Ghaymah!'));app.listen(port, () => console.log(`Listening on ${port}`));gy deploy --name my-express-apiVite (dev preview)
Section titled “Vite (dev preview)”npm run buildgy deploygy serves the production build on the detected port.
Customize
Section titled “Customize”gy deploy --port 8080 --name my-api --tier t2Environment variables
Section titled “Environment variables”const dbUrl = process.env.DATABASE_URL;gy config set env DATABASE_URL=postgres://...gy config sync