Skip to content

Serverless Deployment

Deploy USL applications to serverless platforms.

AWS Lambda

Configuration

serverless.yml:

service: my-app

provider:
  name: aws
  runtime: nodejs18.x
  region: us-east-1

functions:
  api:
    handler: dist/lambda.handler
    events:
      - http:
          path: /{proxy+}
          method: ANY

Deploy

npm install -g serverless
serverless deploy

Google Cloud Functions

// index.js
const { app } = require('./dist/main');

exports.handler = app;

Deploy:

gcloud functions deploy my-app \
  --runtime nodejs18 \
  --trigger-http \
  --allow-unauthenticated

Azure Functions

function.json:

{
  "bindings": [
    {
      "type": "httpTrigger",
      "direction": "in",
      "name": "req"
    },
    {
      "type": "http",
      "direction": "out",
      "name": "res"
    }
  ]
}

Deploy:

func azure functionapp publish my-app

Cold Start Optimization

USL generates optimized code for serverless:

  • Minimal dependencies
  • Lazy loading
  • Connection pooling
  • Warm-up functions

Back to Deployment Overview