Run REST APIs in Node.js applications frameworks (Express, Koa, Hapi and Fastify) on top of any Serverless Cloud.

Overview

πŸš€ Serverless Adapter

Install   |    Usage   |    Support   |    Architecture   |    Credits

npm package Build Status Downloads Issues Code Coverage Commitizen Friendly Semantic Release

Run REST APIs and other web applications using your existing Node.js application framework (Express, Koa, Hapi and Fastify), on top of AWS Lambda, Amazon API Gateway and many other event sources.

This library was a refactored version of @vendia/serverless-express, I created a new way to interact and extend event sources by creating contracts to abstract the integrations between each library layer.

Why you would use this libray instead of @vendia/serverless-express?

  • Better APIs to extend library functionality.
    • You don't need me to release a new version to integrate with the new event source, you can create an adapter and just call the addAdapter method when building your handler.
  • All code can be extended, if you want to modify the current behavior you can.
    • This is important because if you find a bug, you can quickly resolve it by extending the class, and then you can submit a PR to fix the bug.
  • All code was written in Typescript.
  • We have >99% coverage.

Install

Using NPM:

npm install --save @h4ad/serverless-adapter

Using Yarn:

yarn add @h4ad/serverless-adapter

Usage

You can quickly use this library as follows:

import { ServerlessAdapter } from '@h4ad/serverless-adapter';
import { ApiGatewayV2Adapter } from '@h4ad/serverless-adapter/lib/adapters/aws';
import { ExpressFramework } from '@h4ad/serverless-adapter/lib/frameworks/express';
import { DefaultHandler } from '@h4ad/serverless-adapter/lib/handlers/default';
import { PromiseResolver } from '@h4ad/serverless-adapter/lib/resolvers/promise';
import app from './app';

export const handler = ServerlessAdapter.new(app)
  .setFramework(new ExpressFramework())
  .setHandler(new DefaultHandler())
  .setResolver(new PromiseResolver())
  .addAdapter(new AlbAdapter())
  .addAdapter(new SQSAdapter())
  .addAdapter(new SNSAdapter())
  .build();

export { handler };

Too fast? Ok, I can explain.

First, you need to create an instance of the builder with ServerlessAdapter.new(app). The variable app is the instance of your framework (Express, Fastify, Koa, etc).

So you need to specify for this library which framework you will use to handle the request with setFramework, you can only use one. If you use express in our backend, use ExpressFramework , see more in support.

Then you specify which handler you will use to interact with the serverless cloud with setHandler, currently we only have one, the DefaultHandler. In the next releases, maybe we will add support for Azure, Huawei and others, for now, you can use this default.

Then you specify with setResolver which resolver you will use to wait for the library to forward the request to your framework, and then get the response back to your cloud. I recommend you use PromiseResolver, it's the most cloud-agnostic resolver.

By now, you've already added the basic abstractions of this library, now, you can add the adapters that will add support for receiving and processing different sources of addAdapter events. In the example I added AlbAdapter, SQSAdapter and SNSAdapter. With these adapters you can connect your lambda to three different event sources and you can add more if you wish.

Finally, we call build which will assemble your handler that you can expose directly to your cloud.

Final thoughts:

  • You can set the framework only once.
  • You can set the handler only once.
  • You can set the resolver only once.
  • You can have as many adapters as you like, use and extend as you wish.

Support

We are in beta, so some adapters may not work as expected, feel free to create an issue or provide feedback on current behavior.

By design we have these contracts that define the layers of the library: Frameworks, Adapters, Resolvers and Handlers.

If you don't know what each thing means, see Architecture.

Currently, we support these frameworks:

We support these event sources:

We support these resolvers:

We support these handlers:

Architecture

The main purpose of this library is to allow the developer to add support for any cloud and as many event sources as he wants, without having to create an issue to request the feature or copy the library code because the library doesn't expose good APIs for you to extend its functionality

So I refactored @vendia/serverless-express with 4 layers of abstraction: Framework, Handler, Resolver and Adapter.

The FrameworkContract is responsible for forwarding to IncomingMessage and ServerResponse for your application instance. With this abstraction you can implement any framework you want, they just need to accept both parameters and call end in ServerResponse, so the library knows when to continue and return the response.

The HandlerContract is responsible to get the input from the serverless and then manage to call each layer of abstraction to return a response. With this abstraction, you can implement different ways to receive input from your serverless environment. They usually have the same structure, but if you need to deal with a very different cloud, you can use this abstraction to add support for that cloud.

Handler is a good choice for implementing (monsters) ways to receive input. For example, we can create an http server as its handler to test our serverless code without having to launch the framework. Because? I don't know, but you can.

The ResolverContract is responsible for waiting for the framework to handle the request and then returning the response to the cloud. Using AWS for example, you have three ways to wait for the response: returning a promise, calling the callback, and using in-context methods, each option has its own benefits, but generally the promise option will be the better because any good cloud provider will support promises.

Finally, the masterpiece of this library, the AdapterContract is responsible for handling the received event, transforming the request in a way that your application can understand and then transforming the response in a way your cloud can understand.

Well, with these four contracts, you'll be able to add support to any cloud that exists (no more excuses not to use cloud X with NodeJS).

Why you create this library?

The real reason I created this library was because I wanted to add API Gateway and SQS support at the same time to save some money. But, @vendia/serverless-express was not supported, so I created a PR, but until I finished this library, that PR was never accepted.

So I build my own library based on that library with better APIs so I never have to wait for the maintainer to accept my PR just to extend the library's functionality :)

Credits

Honestly, I just refactored all the code that the @vendia team and many other contributors wrote, thanks so much to them for existing and giving us a brilliant library that is the core of my current company.

Comments
  • Apollo Server

    Apollo Server

    Feature request

    Inspired https://github.com/apollo-server-integrations/apollo-server-integration-aws-lambda/issues/38.

    Is your feature request related to an issue? Please describe. Added support for Apollo Server as Framework/Handler.

    Describe the solution you would like

    In theory, we already have support for Apollo Server if we use express as middleware. But maybe we can do better, the solutions are:

    • Add support for Apollo Server as Framework.
    • Add support for Apollo Server as Handler, so you don't need to create another Request/Response.

    In both ways, I don't exactly know how to deal with cors, maybe I can create a CorsFramework to wrap around any other framework to add cors features.

    Are you willing to resolve this issue by submitting a pull request?

    • [x] Yes, I have time and I know how to start.
    • [ ] Yes, I have time, but I don't know how to start. I would need guidance.
    • [ ] No, I don't have time, although I believe I could do it if I had time...
    • [ ] No, I don't have time and I wouldn't even know how to start.
    enhancement released 
    opened by H4ad 6
  • feat: apollo server

    feat: apollo server

    Description of change

    Closes #56

    Pull-Request Checklist

    • [x] Code is up-to-date with the main branch
    • [x] npm run lint passes with this change
    • [x] npm run test passes with this change
    • [x] This pull request links relevant issues as Fixes #0000
    • [x] There are new or updated unit tests validating the change
    • [ ] Added documentation inside www/docs/main folder.
    • [ ] Included new files inside index.doc.ts.
    • [x] The new commits follow conventions outlined in the conventional commit spec
    documentation enhancement released 
    opened by H4ad 3
  • FastifyFramework Issue

    FastifyFramework Issue

    I set my project like below: but i got error log, I use fastify + AWS CDK + Lambda. How to fix this one?

    import { ServerlessAdapter } from "@h4ad/serverless-adapter";
    import { FastifyFramework } from "@h4ad/serverless-adapter/lib/frameworks/fastify";
    import { PromiseResolver } from '@h4ad/serverless-adapter/lib/resolvers/promise';
    import { DefaultHandler } from '@h4ad/serverless-adapter/lib/handlers/default';
    
    
    export const handler = ServerlessAdapter.new(app)
    .setFramework(new FastifyFramework())
    .setHandler(new DefaultHandler())
    .setResolver(new PromiseResolver())
    .build();
    
    {
      "errorType": "Error",
      "errorMessage": "SERVERLESS_ADAPTER: Couldn't find adapter to handle this event.",
      "trace": [
        "Error: SERVERLESS_ADAPTER: Couldn't find adapter to handle this event.",
        "    at DefaultHandler2.getAdapterByEventAndContext (/var/task/index.js:48729:17)",
        "    at Runtime.handler (/var/task/index.js:49490:32)",
        "    at Runtime.handleOnceNonStreaming (/var/runtime/Runtime.js:73:25)"
      ]
    }
    bug 
    opened by tot14883 3
  • docs: fix typo "TrpcContext"">

    docs: fix typo "CustomContext" -> "TrpcContext"

    Description of change

    Fix typo in docs. As far as I can tell it should be TrpcContext instead of CustomContext in this instance.

    Pull-Request Checklist

    • [ ] Code is up-to-date with the main branch (N/A)
    • [ ] npm run lint passes with this change (N/A)
    • [ ] npm run test passes with this changev
    • [ ] This pull request links relevant issues as Fixes #0000 (N/A)
    • [ ] There are new or updated unit tests validating the change (N/A)
    • [ ] Added documentation inside www/docs/main folder. (N/A)
    • [ ] Included new files inside index.doc.ts. (N/A)
    • [X] The new commits follow conventions outlined in the conventional commit spec
    released 
    opened by tobloef 3
  • how to use tRPC with Lambda?

    how to use tRPC with Lambda?

    This repo looks amazing. I'm trying to find examples to use tRPC with AWS Lambda. I know the tRPC project advertises support for Lambda, but I see Typescript compile errors when I try.

    Do you have a tRCP/Lambda sample?

    Thank you!

    question 
    opened by cyrfer 3
  • feat(deepkit): try to add support to deepkit

    feat(deepkit): try to add support to deepkit

    Description of change

    Add support to integrate with @deepkit.

    Pull-Request Checklist

    • [x] Code is up-to-date with the main branch
    • [x] npm run lint passes with this change
    • [x] npm run test passes with this change
    • [x] This pull request links relevant issues as Fixes #0000
    • [x] There are new or updated unit tests validating the change
    • [x] Added documentation inside www/docs/main folder.
    • [x] Included new files inside index.doc.ts.
    • [x] The new commits follow conventions outlined in the conventional commit spec
    enhancement released 
    opened by H4ad 3
  • docs: benchmark

    docs: benchmark

    Description of change

    Added benchmark tests to check if the library is performing good.

    Also, I improve the performance by 100% by just deferring the logging that uses util.inspect. This function takes a lot of time to execute and is very heavy, if the logging library is not configured to log that information, don't worth paying the runtime execution cost to log that information.

    In the future, I will add another way of logging but for now, the solution of deferring the execution by logging a function will work.

    The old stack trace:

    serverless-adapter-old

    The onReceiveRequest functions took 3ms of 9ms execution time.

    The new stack trace:

    serverless-adapter-new

    Before the fix:

    ╔════════════════════════════╀═════════╀════════════════╀═══════════╗
    β•‘ Slower tests               β”‚ Samples β”‚         Result β”‚ Tolerance β•‘
    β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
    β•‘ @h4ad/serverless-adapter   β”‚    5500 β”‚ 4424.96 op/sec β”‚  Β± 0.98 % β•‘
    β•‘ @vendia/serverless-express β”‚    6500 β”‚ 4454.06 op/sec β”‚  Β± 0.97 % β•‘
    β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
    β•‘ Fastest test               β”‚ Samples β”‚         Result β”‚ Tolerance β•‘
    β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
    β•‘ serverless-http            β”‚   10000 β”‚ 8046.93 op/sec β”‚  Β± 1.48 % β•‘
    β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•
    

    After the fix:

    ╔════════════════════════════╀═════════╀════════════════╀═══════════╗
    β•‘ Slower tests               β”‚ Samples β”‚         Result β”‚ Tolerance β•‘
    β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
    β•‘ @vendia/serverless-express β”‚    5500 β”‚ 4518.75 op/sec β”‚  Β± 0.99 % β•‘
    β•‘ @h4ad/serverless-adapter   β”‚   10000 β”‚ 7590.44 op/sec β”‚  Β± 1.29 % β•‘
    β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
    β•‘ Fastest test               β”‚ Samples β”‚         Result β”‚ Tolerance β•‘
    β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
    β•‘ serverless-http            β”‚   10000 β”‚ 8298.48 op/sec β”‚  Β± 1.53 % β•‘
    β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•
    

    Pull-Request Checklist

    • [x] Code is up-to-date with the main branch
    • [x] npm run lint passes with this change
    • [x] npm run test passes with this change
    • [x] This pull request links relevant issues as Fixes #0000
    • [x] There are new or updated unit tests validating the change
    • [x] Added documentation inside www/docs/main folder.
    • [x] Included new files inside index.doc.ts.
    • [x] The new commits follow conventions outlined in the conventional commit spec
    documentation enhancement released 
    opened by H4ad 2
  • feature: gcp

    feature: gcp

    Description of change

    Added support for GCP.

    Pull-Request Checklist

    • [x] Code is up-to-date with the main branch
    • [x] npm run lint passes with this change
    • [x] npm run test passes with this change
    • [x] This pull request links relevant issues as Fixes #0000
    • [x] There are new or updated unit tests validating the change
    • [x] Added documentation inside www/docs/main folder.
    • [x] Included new files inside index.doc.ts.
    • [x] The new commits follow conventions outlined in the conventional commit spec
    enhancement released 
    opened by H4ad 2
  • fix(alb): alb not working when header value is not string

    fix(alb): alb not working when header value is not string

    Fixes https://github.com/vendia/serverless-express/issues/563

    Description of change

    Force all headers to be string when it returns to the cloud.

    Pull-Request Checklist

    • [x] Code is up-to-date with the main branch
    • [x] npm run lint passes with this change
    • [x] npm run test passes with this change
    • [x] This pull request links relevant issues as Fixes #0000
    • [x] There are new or updated unit tests validating the change
    • [x] Added documentation inside www/docs/main folder.
    • [x] Included new files inside index.doc.ts.
    • [x] The new commits follow conventions outlined in the conventional commit spec
    bug released 
    opened by H4ad 2
  • feature: batch support

    feature: batch support

    Closes #20 Closes #21 Closes #71

    Description of change

    In this PR, I did:

    • Fix wrong behavior with responses of adapters not being validated to check if status was successful.
    • Simplify the code for current adapters and new ones by having now AWSSimpleAdapter abstract class.
    • Added support for batch mode for SQS and DynamoDB.

    Pull-Request Checklist

    • [x] Code is up-to-date with the main branch
    • [x] npm run lint passes with this change
    • [x] npm run test passes with this change
    • [x] This pull request links relevant issues as Fixes #0000
    • [x] There are new or updated unit tests validating the change
    • [x] Added documentation inside www/docs/main folder.
    • [x] Included new files inside index.doc.ts.
    • [x] The new commits follow conventions outlined in the conventional commit spec
    bug enhancement released 
    opened by H4ad 2
  • feat(body-parser): added body-parsers frameworks

    feat(body-parser): added body-parsers frameworks

    Description of change

    Close #62

    Pull-Request Checklist

    • [x] Code is up-to-date with the main branch
    • [x] npm run lint passes with this change
    • [x] npm run test passes with this change
    • [x] This pull request links relevant issues as Fixes #0000
    • [x] There are new or updated unit tests validating the change
    • [x] Added documentation inside www/docs/main folder.
    • [x] Included new files inside index.doc.ts.
    • [x] The new commits follow conventions outlined in the conventional commit spec
    enhancement released 
    opened by H4ad 2
  • chore(deps): bump json5 from 2.2.1 to 2.2.3 in /www

    chore(deps): bump json5 from 2.2.1 to 2.2.3 in /www

    Bumps json5 from 2.2.1 to 2.2.3.

    Release notes

    Sourced from json5's releases.

    v2.2.3

    v2.2.2

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).
    Changelog

    Sourced from json5's changelog.

    v2.2.3 [code, diff]

    v2.2.2 [code, diff]

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).
    Commits
    • c3a7524 2.2.3
    • 94fd06d docs: update CHANGELOG for v2.2.3
    • 3b8cebf docs(security): use GitHub security advisories
    • f0fd9e1 docs: publish a security policy
    • 6a91a05 docs(template): bug -> bug report
    • 14f8cb1 2.2.2
    • 10cc7ca docs: update CHANGELOG for v2.2.2
    • 7774c10 fix: add proto to objects and arrays
    • edde30a Readme: slight tweak to intro
    • 97286f8 Improve example in readme
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • chore(deps): bump node-forge, @google-cloud/firestore and @google-cloud/storage

    chore(deps): bump node-forge, @google-cloud/firestore and @google-cloud/storage

    Bumps node-forge, @google-cloud/firestore and @google-cloud/storage. These dependencies needed to be updated together. Updates node-forge from 0.7.6 to 1.3.1

    Changelog

    Sourced from node-forge's changelog.

    1.3.1 - 2022-03-29

    Fixes

    • RFC 3447 and RFC 8017 allow for optional DigestAlgorithm NULL parameters for sha* algorithms and require NULL paramters for md2 and md5 algorithms.

    1.3.0 - 2022-03-17

    Security

    • Three RSA PKCS#1 v1.5 signature verification issues were reported by Moosa Yahyazadeh ([email protected]).
    • HIGH: Leniency in checking digestAlgorithm structure can lead to signature forgery.
    • HIGH: Failing to check tailing garbage bytes can lead to signature forgery.
    • MEDIUM: Leniency in checking type octet.
      • DigestInfo is not properly checked for proper ASN.1 structure. This can lead to successful verification with signatures that contain invalid structures but a valid digest.
      • CVE ID: CVE-2022-24773
      • GHSA ID: GHSA-2r2c-g63r-vccr

    Fixed

    • [asn1] Add fallback to pretty print invalid UTF8 data.
    • [asn1] fromDer is now more strict and will default to ensuring all input bytes are parsed or throw an error. A new option parseAllBytes can disable this behavior.
      • NOTE: The previous behavior is being changed since it can lead to security issues with crafted inputs. It is possible that code doing custom DER parsing may need to adapt to this new behavior and optional flag.
    • [rsa] Add and use a validator to check for proper structure of parsed ASN.1

    ... (truncated)

    Commits

    Updates @google-cloud/firestore from 3.8.6 to 6.4.1

    Release notes

    Sourced from @​google-cloud/firestore's releases.

    v6.4.1

    6.4.1 (2022-10-17)

    Bug Fixes

    • Force use of http by the GAX module when using the GAX fallback and connecting to the emulator (#1788) (50747ad)

    v6.4.0

    6.4.0 (2022-10-07)

    Features

    Bug Fixes

    v6.3.0

    6.3.0 (2022-09-22)

    Features

    Bug Fixes

    • Tests will now verify asynchronous termination of underlying steam, and fix related bug. (#1772) (a1717ff)

    v6.2.0

    6.2.0 (2022-09-13)

    Features

    Bug Fixes

    • Minify proto JSON files (#1771) (6393fe7)
    • Remove hack in update.sh, and replace with existing pattern for protobuf dependencies. (#1769) (6ba6751)

    v6.1.0

    ... (truncated)

    Changelog

    Sourced from @​google-cloud/firestore's changelog.

    6.4.1 (2022-10-17)

    Bug Fixes

    • Force use of http by the GAX module when using the GAX fallback and connecting to the emulator (#1788) (50747ad)

    6.4.0 (2022-10-07)

    Features

    Bug Fixes

    6.3.0 (2022-09-22)

    Features

    Bug Fixes

    • Tests will now verify asynchronous termination of underlying steam, and fix related bug. (#1772) (a1717ff)

    6.2.0 (2022-09-13)

    Features

    Bug Fixes

    • Minify proto JSON files (#1771) (6393fe7)
    • Remove hack in update.sh, and replace with existing pattern for protobuf dependencies. (#1769) (6ba6751)

    6.1.0 (2022-09-07)

    Features

    ... (truncated)

    Commits

    Updates @google-cloud/storage from 4.7.2 to 6.8.0

    Release notes

    Sourced from @​google-cloud/storage's releases.

    v6.8.0

    6.8.0 (2022-12-07)

    Features

    v6.7.0

    6.7.0 (2022-11-03)

    Features

    v6.6.0

    6.6.0 (2022-10-25)

    Features

    • crc32c: Convenient Method For Reading Files (#2095) (2145c81)

    Bug Fixes

    • Remove async from final function which causes double invocation … (#2094) (1a3df98)

    v6.5.4

    6.5.4 (2022-10-20)

    Bug Fixes

    v6.5.3

    6.5.3 (2022-10-18)

    Bug Fixes

    v6.5.2

    6.5.2 (2022-09-23)

    Bug Fixes

    ... (truncated)

    Changelog

    Sourced from @​google-cloud/storage's changelog.

    6.8.0 (2022-12-07)

    Features

    6.7.0 (2022-11-03)

    Features

    6.6.0 (2022-10-25)

    Features

    • crc32c: Convenient Method For Reading Files (#2095) (2145c81)

    Bug Fixes

    • Remove async from final function which causes double invocation … (#2094) (1a3df98)

    6.5.4 (2022-10-20)

    Bug Fixes

    6.5.3 (2022-10-18)

    Bug Fixes

    6.5.2 (2022-09-23)

    Bug Fixes

    • Determine Content-Length Before Attempting Multi-chunk Upload (#2074) (666402a)

    6.5.1 (2022-09-20)

    ... (truncated)

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Possible issues with Cookies

    Possible issues with Cookies

    Hi @laverdet and @ml27299,

    Sorry to tag you both, but I saw you both creating issues on vendia-serverless: https://github.com/vendia/serverless-express/issues/609 and https://github.com/vendia/serverless-express/issues/554.

    My library has the same intention of vendia/serverless-express but I construct it be more extensible and easier to maintain and customize than vendia.

    Because my library is a refactored version of vendia/serverless-express, maybe it could have some issues that you both describe in the issues above.

    I'm proposing that you try my library and let me know if the problems with cookies will persist, if so, I can work on trying to fix these problems. If so, I'll have more description and also someone to test with because I currently don't have APIs that use ALB or cookies, so it's hard for me to test those scenarios.

    For ALB, I have two problems to fix from what I saw from your issues:

    • Force all headers values to be string.
    • Add support to return multiple headers based on this stack overflow answer(suggestion from @laverdet).
    bug 
    opened by H4ad 5
  • Roadmap to V3

    Roadmap to V3

    This is the milestone for being able to update this library to V3.

    Goals:

    • Split each handler, adapter and framework into its own package.
    • Be more independent from NodeJS, so you can easily migrate from NodeJS to Deno or another type of environment such as Bun or Cloudflare Workers.

    About dividing the library into several packages, we will have:

    • @h4ad/serverless-adapter: The core library which contains all contracts and core functionality.
    • @h4ad/serverless-adapter-aws: Contains all AWS Adapters and Handler.
    • @h4ad/serverless-adapter-azure: Which contains all Azure adapters and handler.
    • @h4ad/serverless-adapter-firebase: Contains all Firebase Adapters and Handlers.
    • @h4ad/serverless-adapter-huawei: Contains all Huawei adapters and handlers.
    • @h4ad/serverless-adapter-gcp: Contains all GCP adapters and handlers.
    • @h4ad/serverless-adapter-digital-ocean: Contains all Digital Ocean Adapters and Handlers.
    • @h4ad/serverless-adapter-express: Contains the express framework.
    • @h4ad/serverless-adapter-deepkit: Contains the deepkit framework.
    • @h4ad/serverless-adapter-fastify: Contains the fastify framework.
    • @h4ad/serverless-adapter-hapi: Contains the hapi framework.
    • @h4ad/serverless-adapter-koa: Contains the koa framework.
    • @h4ad/serverless-adapter-apollo-server: Contains the apollo-server framework.
    • @h4ad/serverless-adapter-nodejs: Contains the network code related to Request and Response for NodeJS
    • @h4ad/serverless-adapter-fetch: Contains the network code related to Request and Response for Fetch Spec, that can be used inside Cloudflare Workers and other kind of workers.

    Things to consider:

    • Should I use the monorepo approach?
      • If I use this scheme I must have multiple packages with different typescript versions and different nodejs versions.
    • Should I create an organization instead of leaving it inside my nickname?
    enhancement 
    opened by H4ad 0
  • Jest to Mocha

    Jest to Mocha

    Feature request

    Is your feature request related to an issue? Please describe.

    Currently, code coverage is broken after adding deepkit integration due to loaders in nodejs.

    Describe the desired solution

    Perhaps the only solution that fits better is to use mocha, I've seen https://github.com/GoogleChrome/lighthouse/issues/14047 using mocha so I could work to get back the correct code coverage.

    enhancement 
    opened by H4ad 0
  • CallbackResolver and AWS Lambda

    CallbackResolver and AWS Lambda

    Current Behavior

    Almost all requests using CallbackResolver inside AWS Lambda are taking too long, with PromiseResolver I didn't see this same delay.

    Expected Behavior

    To work as PromiseResolver works.

    Steps to Reproduce the Problem

    1. Use CallbackResolver on setResolver.
    2. Deploy your app inside AWS Lambda.
    3. Make some request.

    Environment

    • Version: 2.6.0
    • Platform: Linux
    • Node.js Version: 14.x
    bug 
    opened by H4ad 0
Releases(v2.15.1)
Owner
Vinicius Lourenço
Apenas uma pessoa que ama programação.
Vinicius Lourenço
Workshop contruyendo una API Rest con Node.js + Koa.js

Workshop contruyendo una API Rest con Node.js + Koa.js Tabla de Contenido Acerca de IntroducciΓ³n ExplicaciΓ³n del caso de uso Ciclo de vida de las soli

Jhony Rivero 6 Apr 8, 2022
Examples and challenges of my video about Creating and testing a complete Node.js Rest API (Without frameworks)

Building a complete Node.js WebApi + testing with no frameworks Welcome, this repo is part of my youtube video about Creating and testing a complete N

Erick Wendel 120 Dec 23, 2022
RESTful API using Hapi NodeJs Framework. This app is project from Dicoding Couses, Belajar Membuat Aplikasi Back-end untuk Pemula

RESTful API using Hapi NodeJs Framework. This app is project from Dicoding Couses, Belajar Membuat Aplikasi Back-end untuk Pemula

Muhammad Ferdian Iqbal 1 Jan 3, 2022
Differences between Node + Koa and Deno + Oak

Node + Koa VS Deno + Oak Differences between Node + Koa and Deno + Oak About This is a project that aims to observe the differences between a simple R

Ronald Guilherme P. dos Santos 3 Jun 28, 2022
Everynode allows you to run any version of Node.js in AWS Lambda, in any commercial AWS region

Run Any Node.js Version in AWS Lambda Everynode allows you to run any version of Node.js in AWS Lambda, in any commercial AWS region. We add support f

Fusebit 116 Dec 15, 2022
This is a vanilla Node.js rest API created to show that it is possible to create a rest API using only vanilla Node.js

This is a vanilla Node.js rest API created to show that it is possible to create a rest API using only vanilla Node.js. But in most cases, I would recommend you to use something like Express in a production project for productivity purposes.

Eduardo Dantas 7 Jul 19, 2022
An unofficial, simplified version of the @Shopify/koa-shopify-auth middleware library.

simple-koa-shopify-auth https://www.npmjs.com/package/simple-koa-shopify-auth NOTE: This package is not maintained by or affiliated with Shopify. Desc

David 20 Nov 7, 2022
Learn Web 2.0 and Web 3.0 Development using Next.js, Typescript, AWS CDK, AWS Serverless, Ethereum and AWS Aurora Serverless

Learn Web 2.0 Cloud and Web 3.0 Development in Baby Steps In this course repo we will learn Web 2.0 cloud development using the latest state of the ar

Panacloud Multi-Cloud Internet-Scale Modern Global Apps 89 Jan 3, 2023
A Serverless GraphQL Sample project using Apollo and Serverless Framework with TypeScript and Webpack.

Serverless GraphQL Boilerplate This is a base project with a structure that includes Serverless Framework, Apollo, TypeScript and Webpack. It can be d

Ravi Souza 5 Aug 23, 2022
A lightweight, performant, and simple-to-use wrapper component to stick section headers to the top when scrolling brings them to top

A lightweight, performant, and simple-to-use wrapper component to stick section headers to the top when scrolling brings them to top

Mayank 7 Jun 27, 2022
πŸš€ Using top-level await in AWS Lambda with TypeScript, esbuild and Serverless Framework

?? Top-level await in AWS Lamba with TypeScript Articles https://dev.to/oieduardorabelo/top-level-await-in-aws-lamba-with-typescript-1bf0 https://medi

Eduardo Rabelo 17 Nov 23, 2022
AWS Lambda & Serverless - Developer Guide with Hands-on Labs. Develop thousands line of aws lambda functions interact to aws serverless services with real-world hands-on labs

AWS Lambda & Serverless - Developer Guide with Hands-on Labs UDEMY COURSE WITH DISCOUNTED - Step by Step Development of this Repository -> https://www

awsrun 35 Dec 17, 2022
awsrun 189 Jan 3, 2023
An AWS Cloud Native application using CDK that defines a Serverless Event Driven application for interacting with Twitter and utilising Machine Learning / AI as a Service.

AWS Serverless Event Driven Twitter Bot An AWS Cloud Native application using CDK (Written in TypeScript) that defines a Serverless Event Driven appli

null 4 Dec 18, 2022
Set up and build a Node.js REST API using Typescript, Express, Mongoose with a maintainable and scalable structure.

Introduction Create a maintainable and scalable Node.js REST API with TypeScript, Express and Mongoose. The project structure is based on MVC and foll

Adam Khomsi 16 Nov 18, 2022
Typescript/JavaScript serverless cloud functions for PocketBase

TS/JS Cloud Functions for PocketBase Write all your PocketBase server-side logic in TS/JS PBScript allows you to write PocketBase server-side function

Ben Allfree 12 Oct 28, 2022
πŸš€ The Ultimate Monorepo Starter for Node.js Serverless Applications

Nx Serverless The Ultimate Monorepo Starter for Node.js Serverless Applications βœ… First-Class Typescript Support βœ… DynamoDB Single Table Design βœ… Shar

ngneat 301 Jan 1, 2023
A Node.js REST API example built with Express and Typescript that can be used as template for creation of new servers.

api-example-firebase-nodejs A Node.js REST API example built with Express and Typescript that can be used as template for creation of new servers. The

Rodrigo JoΓ£o Bertotti 5 Nov 25, 2022
A fast and optimized middleware server with an absurdly small amount of code (300 lines) built on top of Deno's native HTTP APIs

A fast and optimized middleware server with an absurdly small amount of code (300 lines) built on top of Deno's native HTTP APIs with no dependencies. It also has a collection of useful middlewares: log file, serve static, CORS, session, rate limit, token, body parsers, redirect, proxy and handle upload. In "README" there are examples of all the resources. Faster's ideology is: all you need is an optimized middleware manager, all other functionality is middleware.

Henrique Emanoel Viana 19 Dec 28, 2022