Skip to content

Latest commit

 

History

History
59 lines (38 loc) · 2.01 KB

README.md

File metadata and controls

59 lines (38 loc) · 2.01 KB

OpenFaaS Deno HTTP template

An OpenFaaS of-watchdog template written for Deno.

Installation

$ faas template pull https://github.com/austinrivas/deno-http-template
$ faas new --list
Languages available as templates:
- deno-http

Create Function

faas new <name> --lang deno-http

Testing

Deno provides a built in test runner.

deno test --allow-net

This repo also includes vscode debug configurations.

  • Run Tests
  • Debug Current Test File
  • Debug Seleted Test Case

Linting

Deno also provides a built in code linter.

deno fmt

Usage

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.

Example Function

A working example of this function template can be found here.

Extras

This repo also contains a base image that can be extended as needed by other templates.

The base image is consumed by the deno template itself and the included okteto image which can be used for remote development on the Okteto Platform for remote OpenFaaS development.

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.