Skip to main content

API Reference

domain

The domain name of your app or website.

npx webpod [email protected] --domain=example.com

port

The SSH port of your server. Usually, the SSH port is 22. If you're using a non-standard port, you can specify it with --port option.

npx webpod [email protected] --port=2222

become

The user to become after connecting to the server. This is useful if you're connecting to the server as ubuntu user, but you need to run commands as root user.

npx webpod [email protected] --become=root

uploadDir

The directory to upload to the server.

npx webpod --uploadDir=build

publicDir

The directory to serve as the public root.

npx webpod --publicDir=public

If your public directory is the same as your upload directory, you can set publicDir to .:

npx webpod --uploadDir=build --publicDir=.

scripts

The Node.js scripts to run on the server.

npx webpod --scripts=app.js

Webpod runs Node.js apps in a cluster mode to take advantage of multiple CPU cores. Each of your CPU cores will run a separate Node.js process. This allows your app to handle more requests. Each Node.js process will be restarted automatically if it crashes. This ensures your app is always available. Additionally, Webpod will automatically restart your app when you deploy a new version.

Webpod will automatically assign a port to your app. You can access the port with process.env.PORT variable.

import http from 'node:http'

const server = http.createServer((req, res) => {
res.end('Hello World!')
})

server.listen(process.env.PORT)