WARNING: WIP
A lightweight, open source FaaS (Function as a Service) framework for Deno.
The framework allows you to go from:
import type { Context } from "https://deno.land/x/oak@v9.0.0/mod.ts";
export function hello(ctx: Context) {
ctx.response.body = "Hello, World!";
}
To:
curl http://my-url
# Output: Hello, World!
All without needing to worry about writing an HTTP server or complicated request handling logic.
- Spin up a local development server for quick testing
- Invoke a function in response to a request
Automatically unmarshal events conforming to the CloudEvents spec- Portable between serverless platforms
There's no installation step for this library. It's Deno.
Assumes you have Deno installed
-
Create an
test/hello.ts
file with the following contents:import type { Context } from "https://deno.land/x/oak@v9.0.0/mod.ts"; export function hello(ctx: Context) { ctx.response.body = "Hello, World!"; }
-
Start the local server:
deno run -A ./run.ts --target=hello --source=test/hello.ts
-
Send requests to this function using
curl
from another terminal window:curl localhost:8080 Output: Hello, World!
TODO: FIXME
You can also run this server in a container:
docker build -t app . && docker run -it --init -p 8080:8080 app
gcloud beta run deploy deno-ff \
--source . \
--allow-unauthenticated
TODO: Publish this to a separate repo: