Skip to content

Node.js

Any project with a package.json is detected as Node.js. gy infers your start command and port automatically.

Terminal window
cd my-node-app
gy deploy
  • Package manager — npm, yarn, or pnpm lockfiles
  • Port — from PORT env, the start script, or common defaults
  • Start command — your start script
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}`));
Terminal window
gy deploy --name my-express-api
Terminal window
npm run build
gy deploy

gy serves the production build on the detected port.

Terminal window
gy deploy --port 8080 --name my-api --tier t2
const dbUrl = process.env.DATABASE_URL;
Terminal window
gy config set env DATABASE_URL=postgres://...
gy config sync