architect / functions-deno

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deno @architect-functions

Runtime helper library for serverless apps built with [Architect][Deno]

Example

Http async

import arc from 'https://raw.githubusercontent.com/architect/functions-deno/main/src/index.js'

export const handler = arc.http.async( (event: Record<string, unknown>) => {
    console.log(JSON.stringify(event, null, 2));

    return {
        location: "/"
    }
});

Auth

Test

Integration only: deno test --allow-run --allow-read --allow-env --allow-write --allow-net --unstable ./test/integration

Unit only: deno test --allow-run --allow-read --allow-env --allow-write --allow-net --unstable ./test/unit

Notes

  • Deno.run use to launch a sub process of arc sandbox within the mock path - not possible to directly call sandbox through JS

  • Having to use sanitizeResources: false,sanitizeOps: false on Deno.test quite a bit - does this suggest a problem in the codebase / the tests / or is this safe?

Todo

  • unexpress (src/https/express)
  • JWE - Session tokens incompatible with node/ruby/python - currently there's no availaility of a library that uses the A128GCM algorithm. Possible that if webcrypto APIs are implemented in Deno then jose would be available.
  • no zlib. compress.js uses gzipDecode/ gzipEncode, deflate/inflate and compress/decompress (brotli) instead

Test with suffix .test-fail.js are skipped, we need to refactor based on:

  • No mockfs equivalant and can't use Skypack / jspm,
  • No proxyquire

About

License:Apache License 2.0


Languages

Language:JavaScript 97.9%Language:TypeScript 2.0%Language:Arc 0.1%Language:Shell 0.0%