An OpenFaaS of-watchdog function written for Deno.
faas template pull https://github.com/austinrivas/deno-http-templatefaas new <name> --lang deno-httpDeno ships with a built in test runner
deno test --allow-netThis repo also includes vscode debug configurations for local debugging.
- Run Tests
- Debug Current Test File
- Debug Seleted Test Case
Deno also provides a built in code linter.
deno fmtfaas up -f function.yml --gateway $GATEWAY_URLThis function includes an okteto.yml function to facilitate remote dev and debugging.
To launch to remote debugger you must start the debug process in oketeto.
cd function
okteto up
✓ Development environment activated
✓ Files synchronized
Namespace: austinrivas
Name: deno-hello
Forward: 8080 -> 8080
9229 -> 9229
okteto> fwatchdogOnce the debug session is listening you can attach to it from chrome://inspect and set breakpoints as required.
When you are done debugging you should exit the okteto shell and run okteto down to restore the OpenFaaS function context.
This function is based on the OpenFaaS deno-http-template.
This template provides a thin wrapper around the Deno Http Server provided by the Deno stdlib. The wrapper implementation closely mirrors the Deno serve function.
The function handler in this example is as simple as possible. It merely consumes the Deno ServerRequest and responds with a "Deno says Hello OpenFaaS!" message.
This repo also contains an Okteto Remote Development Configuration for use on the Okteto Platform.
A Test and Enforce Deno Format github action is included that will trigger on pull request. This action runs the deno tests and throws an error if deno fmt returns changes.