Deployment Overview

MoroJS supports multiple runtime environments out of the box. Deploy your APIs anywhere from traditional servers to modern edge computing platforms.

Multi-Runtime Architecture

Write your API once and deploy it anywhere. MoroJS automatically adapts to different runtime environments:

  • Same codebase works across all platforms
  • Automatic runtime detection and optimization
  • Platform-specific features when available
  • Consistent API across all environments

Universal Deployment Code

typescript

1import { createApp } from '@morojs/moro';
2
3const app = createApp();
4
5app.get('/api/hello', () => {
6  return { 
7    message: 'Hello from MoroJS!',
8    runtime: process.env.RUNTIME || 'node',
9    timestamp: new Date().toISOString()
10  };
11});
12
13// Works on all platforms
14export default app;
15
16// Or for Node.js
17app.listen(3000);

Supported Runtimes

Quick Deploy Examples

Vercel

vercel.json

typescript

1{
2  "functions": {
3    "api/[...route].ts": {
4      "runtime": "@vercel/node"
5    }
6  }
7}

api/[...route].ts

typescript

1import { createApp } from '@morojs/moro';
2import { createVercelAdapter } from '@morojs/vercel';
3
4const app = createApp();
5// Your routes here...
6
7export default createVercelAdapter(app);

Docker

Dockerfile

typescript

1FROM node:18-alpine
2WORKDIR /app
3COPY package*.json ./
4RUN npm ci --only=production
5COPY . .
6RUN npm run build
7EXPOSE 3000
8CMD ["npm", "start"]

Runtime Performance

RuntimeCold StartThroughputBest For
Node.js~200ms68k+ req/secAPIs, WebSockets, File processing
Vercel Edge~50ms45k+ req/secGlobal APIs, CDN integration
AWS Lambda~300ms40k+ req/secEvent processing, AWS integration
Cloudflare Workers~10ms50k+ req/secEdge computing, Global distribution

Choose Your Runtime