{"id":14848256,"url":"https://github.com/kksharma1618/lambda-restify","last_synced_at":"2026-01-14T15:55:51.683Z","repository":{"id":86698212,"uuid":"97483699","full_name":"kksharma1618/lambda-restify","owner":"kksharma1618","description":"A restify/expressjs like interface for aws lamda with api gateway event","archived":false,"fork":false,"pushed_at":"2018-08-10T19:36:08.000Z","size":69,"stargazers_count":10,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-30T12:58:01.760Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/kksharma1618.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-07-17T14:09:05.000Z","updated_at":"2025-02-11T15:49:31.000Z","dependencies_parsed_at":"2023-03-13T19:54:52.514Z","dependency_job_id":null,"html_url":"https://github.com/kksharma1618/lambda-restify","commit_stats":{"total_commits":53,"total_committers":2,"mean_commits":26.5,"dds":"0.49056603773584906","last_synced_commit":"fde234bb5dc9f51681e825443b105c5b5308ecd7"},"previous_names":["kksharma1618/lamda-restify"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/kksharma1618/lambda-restify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kksharma1618%2Flambda-restify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kksharma1618%2Flambda-restify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kksharma1618%2Flambda-restify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kksharma1618%2Flambda-restify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kksharma1618","download_url":"https://codeload.github.com/kksharma1618/lambda-restify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kksharma1618%2Flambda-restify/sbom","scorecard":{"id":562896,"data":{"date":"2025-08-11","repo":{"name":"github.com/kksharma1618/lambda-restify","commit":"fde234bb5dc9f51681e825443b105c5b5308ecd7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T14:11:02.003Z","repository_id":86698212,"created_at":"2025-08-20T14:11:02.010Z","updated_at":"2025-08-20T14:11:02.010Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28425573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T15:24:48.085Z","status":"ssl_error","status_checked_at":"2026-01-14T15:23:41.940Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-09-19T13:01:50.673Z","updated_at":"2026-01-14T15:55:51.665Z","avatar_url":"https://github.com/kksharma1618.png","language":"TypeScript","readme":"# lambda-restify\n\n[![Build Status](https://travis-ci.org/kksharma1618/lambda-restify.svg?branch=master)](https://travis-ci.org/kksharma1618/lambda-restify)\n\nA [restify](http://restify.com/)/[expressjs](https://expressjs.com/) like interface for aws lambda with api gateway event.\n\n## Installation\n```\nnpm install --save lambda-restify\n```\n\n## What is it about\nIf you are writing [aws lambda function](https://aws.amazon.com/lambda/) to develop rest apis using [aws api gateway](https://aws.amazon.com/api-gateway/), this package will help you with request/response/routing/middlewares/versioned apis type features generally found in packages like restify or express.\n\nInstead of using http module for opening a server and listening for incoming requests, this package relies on lambda event and callback.\n\nWhen you make an http request against aws apigateway it triggers aws lambda with an event containing all the information about the incoming request (like method, url, querystring, headers, and body). lambda-restify relies on that information to create request object.\n\nWhen your route handler sends response back (including headers, content), lambda-restify triggers lambda callback.\n\n## Supported features\n- Full support for restify request/response api\n- Pre routing hooks \n- Middlewares\n- Routing\n- Versioned apis\n\n## Dependency\nIt requires node \u003e= 6.10.0. Make sure you choose \"6.10.2\" or above while creating lambda function. At the time of writing lambda supports v4.3.2 and 6.10.2.\n\n## Getting started\n\n### Install the package\n```\nnpm install --save lambda-restify\n```\n### Create server\nSee list of supported options [here](https://github.com/kksharma1618/lambda-restify/blob/master/src/lib/server_options.ts).\n\n``` javascript\nconst Server = require('lambda-restify').default;\nconst server = new Server(options);\n```\n\nOr, if you are using imports\n\n``` javascript\nimport Server from 'lambda-restify';\nconst server = new Server(options);\n```\n\n### Attach your routes and middlewares\nSee [restify documentation](http://restify.com/docs/home/) for documentation on server.pre, server.use, server.get (and other http verbs). Since lambda-restify uses restify like interface all that docs apply here as well.\n\n``` javascript\nserver.pre(function(req, res, next) {\n    // this handler is run for all routes, even 404\n    \n    // do something here\n    next()\n})\n\nserver.use(function(req, res, next) {\n    // this handler is run for after routing is done \n    // and successful match is found (not on 404)\n\n    // do something here\n    next()\n})\n\nserver.post('/user/:id', function(req, res) {\n    \n    // headers available \n    const apiKey = req.header('apikey');\n    \n    // route param\n    const userId = req.params.id;\n    \n    // query string\n    const queryValue = req.query('queryKey')\n\n    // body\n    const name = req.body.name\n\n    // send response with res.json or res.send\n    res.json({\n        status: 1\n    })\n})\n\n// define other route handlers\n\n```\n\n### Attach lambda handler\n``` javascript\nexports.yourlambdaHandler = function(event, context, callback) {\n    server.handleLambdaEvent(event, context, callback)\n}\n```\n\n## Documentation\n\n**Note**\u003cbr /\u003e\nMost likely, you will need to set: \n``` javascript \ncontext.callbackWaitsForEmptyEventLoop = false \n```\nbefore calling server.handleLamdaEvent in your lamda handler. See [http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html](http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html) for details. \n\nSee [restify documentation](http://restify.com/docs/home/). Following items work just as they did in restify:\n- Request:\n    - headers\n    - url\n    - httpVersion\n    - method\n    - params\n    - body\n    - rawBody\n    - header(name: string, defaultValue: string)\n    - accepts(type: string | string[])\n    - acceptsEncoding(type: string | string[])\n    - getContentLength()\n    - contentLength() [alias of getContentLength]\n    - getContentType()\n    - contentType() [alias of getContentType]\n    - time()\n    - date()\n    - getQuery()\n    - query() [alias of getQuery()]\n    - getUrl()\n    - href()\n    - id(reqId?: string)\n    - getId()\n    - getPath()\n    - path() [alias of getPath]\n    - is(type: string)\n    - isSecure()\n    - isChunked()\n    - toString()\n    - userAgent()\n    - version()\n    - matchedVersion()\n    - trailer(name: string, value?: string) [no trailers support. it just pass back the default value]\n    - isKeepAlive()\n    - isUpload()\n- Response\n    - finished\n    - headersSent\n    - sendDate\n    - statusCode\n    - statusMessage\n    - serverName\n    - cache(type?: any, options?: any)\n    - noCache()\n    - header(name: string, value?: any)\n    - setHeader(name: string, value: any)\n    - getHeaders()\n    - headers() [alias of getHeaders]\n    - send(code?: number, body?: string | json, headers?: json)\n    - sendRaw(code?: number, body?: string | json, headers?: json)\n    - removeHeader(name: string)\n    - writeHead(code?, message?, headers?)\n    - write(chunk: string | Buffer, encoding?: string, callback?: any)\n    - end(data?: string | Buffer, encoding?: string, callback?)\n    - get(name: string)\n    - json(code?, body?, headers?)\n    - link(l, rel)\n    - charSet(type: string)\n    - redirect(...)\n    - status(code: number)\n    - set(name: string | object, val?: string)\n    - getHeaderNames()\n    - hasHeader(name: string)\n- Server\n    - pre(handlers)\n    - use(handlers)\n    - get(path?, options?, handlers)\n    - del(path?, options?, handlers)\n    - head(path?, options?, handlers)\n    - opts(path?, options?, handlers)\n    - post(path?, options?, handlers)\n    - put(path?, options?, handlers)\n    - patch(path?, options?, handlers)\n    - param(name, fn)\n    - versionedUse(versions: string | string[], fn)\n\n**Server.handleLambdaEvent(lambdaEvent, context, lambdaCallback)**\u003cbr /\u003e\nPlug this into lambda handler to route all incoming lambda events.\n","funding_links":[],"categories":["Frameworks"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkksharma1618%2Flambda-restify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkksharma1618%2Flambda-restify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkksharma1618%2Flambda-restify/lists"}