Functions

Deploy serverless functions in seconds

Managed Deno runtime on your own server. Write TypeScript functions, upload them, and invoke via HTTPS. No build step, no container images, no vendor lock-in.

Write a function, deploy it, call it

// handler.ts
export default async function(req: Request) {
const url = new URL(req.url);
const name = url.searchParams.get('name') ?? 'world';
return new Response(
JSON.stringify({ hello: name }),
{ headers: { 'Content-Type': 'application/json' } },
);
}
# Invoke your function
curl https://my-functions.sh0.app/?name=sh0
{"hello":"sh0"}

Serverless without the compromises

All the benefits of serverless functions with the control of self-hosting.

TypeScript & JavaScript

Write functions in TypeScript or JavaScript. Full Deno runtime with top-level await, ES modules, and the standard Web API (fetch, crypto, streams).

Instant Deploy

Upload your function file and it is live immediately. No build step, no container image, no cold start. Deno compiles and caches on first request.

Auto-SSL Endpoint

Each function instance gets its own HTTPS endpoint via Caddy. Invoke from any frontend, webhook, or cron job over a secure connection.

Lightweight Runtime

Each Deno instance uses approximately 256 MB of memory. Fast startup, small footprint, efficient execution.

Sandboxed Execution

Deno runs in a secure sandbox by default. No file system access, no network access unless explicitly granted. Safe by design.

HTTP Invocation

Functions are invoked via standard HTTP requests. Return any content type -- JSON, HTML, plain text, binary. Use them as API endpoints, webhooks, or micro-services.

How It Works

01

Create Function Instance

Click "Create Function Server" in the sh0 dashboard. Choose a name for your serverless runtime.

02

Write Your Function

Write a TypeScript or JavaScript function that handles HTTP requests. Export a default function that takes a Request and returns a Response.

03

Deploy

Upload your function file via the dashboard or API. It is compiled and ready to serve in seconds.

04

Invoke

Call your function via its HTTPS endpoint. Pass data as query params, headers, or request body.

Execution Flow

HTTP Request
Caddy (SSL)
Deno Runtime
Your Function
Response

Direct execution. No container cold starts, no orchestration overhead.

Cloud Functions (AWS/GCP/Azure)

  • x Per-invocation billing adds up fast
  • x Cold starts degrade user experience
  • x Vendor-specific APIs and tooling
  • x Complex IAM and networking config
  • x Difficult to test and debug locally
  • x Data transfer costs between services

sh0 + Deno Functions

  • Flat pricing, unlimited invocations
  • No cold starts -- Deno compiles and caches
  • Standard Web APIs (Request/Response)
  • Simple HTTPS endpoint, no config needed
  • Same Deno runtime locally and in production
  • Direct access to your databases, no egress fees

Frequently Asked Questions

What languages are supported? +
TypeScript and JavaScript via the Deno runtime. Deno supports TypeScript natively -- no compilation step or tsconfig needed.
Is there a cold start? +
Deno compiles and caches your function on the first request. Subsequent requests are served from the cache with negligible latency.
Can functions access my databases? +
Yes. Your functions can connect to any PostgreSQL, MySQL, or Redis database server managed by sh0 using standard connection strings.
What is the request/response format? +
Functions receive a standard Web API Request object and must return a Response object. This is the same API used in Deno Deploy, Cloudflare Workers, and other edge runtimes.
Can I use npm packages? +
Yes. Deno supports importing from npm via the npm: specifier (e.g., import express from "npm:express"). You can also import from URLs or deno.land/x.
How is this different from AWS Lambda? +
sh0 Functions run on your own server -- no vendor lock-in, no per-invocation billing, no cold start penalties. You control the infrastructure.

Ship functions, not infrastructure

Write TypeScript, deploy to your server, invoke via HTTPS. That is it.