Skip to content

Commit 4f5a801

Browse files
committed
Updated README
1 parent 0641f8b commit 4f5a801

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

README.md

+30-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# now-deno
2+
23
> ZEIT Now Deno builder - run Deno on Zeit. 🦕 + λ = ❤
34
45
This builder allows you to run [Deno](https://deno.land) as a lambda on ZEIT Now.
@@ -8,13 +9,37 @@ This builder allows you to run [Deno](https://deno.land) as a lambda on ZEIT Now
89
If you're unfamiliar with now runtimes, please read the [runtime docs](https://zeit.co/docs/runtimes) first. This runtime can be used like any other Community Runtime.
910

1011
```json
12+
// now.json
1113
{
12-
"functions": {
13-
"api/**/*.ts": {
14-
"runtime": "[email protected]"
15-
}
16-
}
14+
"functions": {
15+
"api/**/*.ts": {
16+
"runtime": "[email protected]"
17+
}
18+
}
19+
}
20+
```
21+
22+
```ts
23+
// api/hello.ts
24+
import { Context, Event } from 'https://deno.land/x/lambda/mod.ts';
25+
26+
export async function handler(event: Event, context: Context) {
27+
return {
28+
statusCode: 200,
29+
body: `Welcome to deno ${Deno.version.deno} 🦕`,
30+
headers: {
31+
'content-type': 'text/html; charset=utf-8',
32+
},
33+
};
1734
}
1835
```
36+
1937
That's the simplest way to use this runtime!
2038

39+
## Advanced usage
40+
41+
You can place a `build.sh` function in the root of your deploy directory. This will be executed before the lambda is built.
42+
43+
## Credits
44+
45+
This was only possible due to the great work of [Andy Hayden](https://github.com/hayd) who made the first attempts at running [deno in a lambda function](https://github.com/hayd/deno-lambda).

0 commit comments

Comments
 (0)