{"id":13469507,"url":"https://github.com/H4ad/serverless-adapter","last_synced_at":"2025-03-26T06:32:15.789Z","repository":{"id":37003343,"uuid":"476532369","full_name":"H4ad/serverless-adapter","owner":"H4ad","description":"Run REST APIs and other web applications using your existing Node.js application framework (NestJS, Express, Koa, tRPC, Fastify and many others), on top of AWS, Azure, Huawei and many other clouds.","archived":false,"fork":false,"pushed_at":"2025-03-14T07:51:45.000Z","size":18013,"stargazers_count":145,"open_issues_count":27,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T09:45:03.147Z","etag":null,"topics":["aws","aws-lambda","azure","azure-functions","deepkit","digital-ocean","fastify","firebase","firebase-functions","hapi","huawei","koa","lambda","nodejs","serverless","sns","sqs","trpc"],"latest_commit_sha":null,"homepage":"https://serverless-adapter.viniciusl.com.br/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/H4ad.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-01T01:23:31.000Z","updated_at":"2025-03-18T04:50:35.000Z","dependencies_parsed_at":"2024-03-25T23:27:31.387Z","dependency_job_id":"f03d3de9-fffb-4b58-8ffa-bbcfa5da212a","html_url":"https://github.com/H4ad/serverless-adapter","commit_stats":{"total_commits":351,"total_committers":12,"mean_commits":29.25,"dds":0.2564102564102564,"last_synced_commit":"ed671ae544dd2d0126f01effcc30e942f4883cbd"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/H4ad%2Fserverless-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/H4ad%2Fserverless-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/H4ad%2Fserverless-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/H4ad%2Fserverless-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/H4ad","download_url":"https://codeload.github.com/H4ad/serverless-adapter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245449658,"owners_count":20617190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","azure","azure-functions","deepkit","digital-ocean","fastify","firebase","firebase-functions","hapi","huawei","koa","lambda","nodejs","serverless","sns","sqs","trpc"],"created_at":"2024-07-31T15:01:42.777Z","updated_at":"2025-03-26T06:32:15.780Z","avatar_url":"https://github.com/H4ad.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003e\n  🚀 Serverless Adapter\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#install\"\u003eInstall\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#support\"\u003eSupport\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#examples\"\u003eExamples\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#benchmark\"\u003eBenchmark\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#architecture\"\u003eArchitecture\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#credits\"\u003eCredits\u003c/a\u003e\n\u003c/p\u003e\n\n[![npm package][npm-img]][npm-url]\n[![Build Status][build-img]][build-url]\n[![Downloads][downloads-img]][downloads-url]\n[![Issues][issues-img]][issues-url]\n[![Code Coverage][codecov-img]][codecov-url]\n[![Commitizen Friendly][commitizen-img]][commitizen-url]\n\nRun REST APIs and other web applications using your existing Node.js application framework (NestJS, Deepkit, Express (v4 and v5), Koa, Hapi,\nFastify, tRPC and Apollo Server), on top of AWS Lambda, Azure, Digital Ocean and many other clouds.\n\nThis library was a refactored version of [@vendia/serverless-express](https://github.com/vendia/serverless-express), I\ncreate a new way to interact and extend event sources by creating contracts to abstract the integrations between each\nlibrary layer.\n\nWhy you would use this libray instead of [@vendia/serverless-express](https://github.com/vendia/serverless-express)?\n\n- Better APIs to extend library functionality.\n  - You don't need me to release a new version to integrate with the new event source, you can create an adapter and\n    just call the `addAdapter` method when building your handler.\n- All code can be extended, if you want to modify the current behavior you can.\n  - This is important because if you find a bug, you can quickly resolve it by extending the class, _and then you can\n    submit a PR to fix the bug_.\n- All code was written in Typescript.\n- Well documented, any method, class, or interface has comments to explain the behavior.\n- We have \u003e99% coverage.\n\n# Installing\n\nTo be able to use, first install the library:\n\n```bash\nnpm i --save @h4ad/serverless-adapter\n```\n\n# Usage\n\nTo start to use, first you need to know what you need to import, let's start showing the [ServerlessAdapter](/docs/api/ServerlessAdapter).\n\n```tsx\nimport { ServerlessAdapter } from '@h4ad/serverless-adapter';\n```\n\nWe need to pass to [Serverless Adapter](/docs/api/ServerlessAdapter) the instance of your api, let's look an example with:\n\n- Framework: [Express](../frameworks/express).\n- Adapters: [AWS Api Gateway V2 Adapter](../adapters/aws/api-gateway-v2).\n- Handler: [Default Handler](../handlers/default).\n- Resolver: [Promise Resolver](../resolvers/promise).\n\n```ts\nimport { ServerlessAdapter } from '@h4ad/serverless-adapter';\nimport { ExpressFramework } from '@h4ad/serverless-adapter/lib/frameworks/express';\nimport { DefaultHandler } from '@h4ad/serverless-adapter/lib/handlers/default';\nimport { PromiseResolver } from '@h4ad/serverless-adapter/lib/resolvers/promise';\nimport { ApiGatewayV2Adapter } from '@h4ad/serverless-adapter/lib/adapters/aws';\n\nconst express = require('express');\n\nconst app = express();\nexport const handler = ServerlessAdapter.new(app)\n  .setFramework(new ExpressFramework())\n  .setHandler(new DefaultHandler())\n  .setResolver(new PromiseResolver())\n  .addAdapter(new ApiGatewayV2Adapter())\n  // if you need more adapters\n  // just append more `addAdapter` calls\n  .build();\n```\n\n# Documentation\n\nSee how to use this library [here](https://viniciusl.com.br/serverless-adapter/docs/category/getting-started).\n\n# Breaking Changes\n\nI will not consider updating/breaking compatibility of a NodeJS framework as a breaking change,\nbecause I had a lot of supported frameworks and if I created a major version for each one it would be a mess.\n\nSo if you want predictability, pin the version with `~` instead of `^`.\n\n# Examples\n\nYou can see some examples of how to use this library [here](https://github.com/H4ad/serverless-adapter-examples).\n\n# Benchmark\n\nSee the speed comparison between other libraries that have the same purpose in the [Benchmark Section](./benchmark).\n\n# Credits\n\nHonestly, I just refactored all the code that the @vendia team and many other contributors wrote, thanks so much to them\nfor existing and giving us a brilliant library that is the core of my current company.\n\n# Sponsors\n\n| \u003ca href=\"https://liga.facens.br/\"\u003e\u003cimg height=\"50\" src=\"https://mlogu6g7z5ex.i.optimole.com/yEwfkqo-4R0ttNtd/w:auto/h:auto/q:mauto/f:avif/http://liga.facens.br/wp-content/uploads/2020/03/logo-1.png\" title=\"The LIGA logo\" width=\"100\"/\u003e\u003c/a\u003e |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n[build-img]:https://github.com/H4ad/serverless-adapter/actions/workflows/release.yml/badge.svg\n\n[build-url]:https://github.com/H4ad/serverless-adapter/actions/workflows/release.yml\n\n[downloads-img]:https://img.shields.io/npm/dt/serverless-adapter\n\n[downloads-url]:https://www.npmtrends.com/@h4ad/serverless-adapter\n\n[npm-img]:https://img.shields.io/npm/v/@h4ad/serverless-adapter\n\n[npm-url]:https://www.npmjs.com/package/@h4ad/serverless-adapter\n\n[issues-img]:https://img.shields.io/github/issues/H4ad/serverless-adapter\n\n[issues-url]:https://github.com/H4ad/serverless-adapter/issues\n\n[codecov-img]:https://codecov.io/gh/H4ad/serverless-adapter/branch/main/graph/badge.svg\n\n[codecov-url]:https://codecov.io/gh/H4ad/serverless-adapter\n\n[commitizen-img]:https://img.shields.io/badge/commitizen-friendly-brightgreen.svg\n\n[commitizen-url]:http://commitizen.github.io/cz-cli/\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FH4ad%2Fserverless-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FH4ad%2Fserverless-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FH4ad%2Fserverless-adapter/lists"}