🥞PancakeJS

Deployment Overview

Pancake apps are Node.js servers. They can run anywhere that supports Node.js, from serverless platforms like Cloudflare Workers and Vercel to traditional VPS and container deployments.

Build for Production

# Build the server
pnpm build

# Run production build
pnpm start

The build process:

  1. Compiles TypeScript to JavaScript
  2. Bundles view assets (React components, CSS)
  3. Outputs to dist/

Build Output

dist/
├── index.js              # Server bundle
└── ui/                   # Built view assets (React template)
    └── views/
        └── hello/
            └── index.html

Deployment Platforms

Cloudflare

Deploy to Cloudflare Workers or use Cloudflare Tunnel for permanent access to your server.

Vercel

Deploy as a serverless function with automatic scaling.

Railway / Render

Container deployments with automatic SSL and easy scaling.

Docker

Self-hosted deployments on any infrastructure.

Node.js Server Deployment

For traditional Node.js hosting (Railway, Render, DigitalOcean, AWS EC2):

1. Build

pnpm build

2. Start

NODE_ENV=production node dist/index.js

3. Environment Variables

# Required
PORT=3000

# Optional
NODE_ENV=production

Docker Deployment

Create a Dockerfile:

FROM node:22-alpine

WORKDIR /app

# Copy package files
COPY package.json pnpm-lock.yaml ./

# Install pnpm and dependencies
RUN corepack enable && pnpm install --frozen-lockfile --prod

# Copy built files
COPY dist ./dist

# Expose port
EXPOSE 3000

# Start server
CMD ["node", "dist/index.js"]

Build and run:

# Build
pnpm build
docker build -t my-pancake-app .

# Run
docker run -p 3000:3000 my-pancake-app

Serverless Deployment

For Vercel, Cloudflare Workers, or AWS Lambda, you need to adapt the server slightly:

// For serverless environments
export default async function handler(req: Request): Promise<Response> {
  // Handle the request
  return app.handleRequest(req);
}

See platform-specific guides:

Configuration for Production

Update your server config for production:

const app = createApp({
  name: 'my-app',
  version: '1.0.0',

  config: {
    // Disable debug in production
    debug: process.env.NODE_ENV !== 'production',

    // No tunnel in production (you'll have a real domain)
    // tunnel: undefined,

    // CORS for your domains
    cors: {
      origin: ['https://yourdomain.com'],
      credentials: true,
    },
  },

  views: { /* ... */ },
});

const port = parseInt(process.env.PORT || '3000');
app.start({ port });

Connecting AI Clients to Production

Claude Desktop

Add your production URL to Claude's config:

{
  "mcpServers": {
    "my-app": {
      "url": "https://my-app.example.com/mcp"
    }
  }
}

ChatGPT

Configure your Custom GPT with:

  • OpenAPI spec: https://my-app.example.com/openapi.json
  • Plugin manifest: https://my-app.example.com/.well-known/openai-plugin.json

Security Checklist

Before deploying to production:

  • HTTPS only: Use TLS certificates (most platforms provide these automatically)
  • Environment variables: Store secrets in environment variables, not code
  • CORS configured: Restrict origins to your domains
  • Debug disabled: Set debug: false in production
  • Rate limiting: Consider adding rate limiting for public endpoints
  • Monitoring: Set up logging and error tracking

Health Checks

Add a health endpoint for monitoring:

// Most platforms expect /health or /healthz
// Pancake apps respond to these automatically

Test it:

curl https://my-app.example.com/health
# Returns: {"status":"ok"}

Next Steps

Pick a deployment platform and follow the detailed guide:

On this page