{"id":19711889,"url":"https://github.com/ricoledan/github-api-sls-nodejs","last_synced_at":"2026-06-03T23:31:12.107Z","repository":{"id":173188153,"uuid":"650278365","full_name":"Ricoledan/github-api-sls-nodejs","owner":"Ricoledan","description":"🎲","archived":false,"fork":false,"pushed_at":"2023-06-06T23:26:46.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T19:57:59.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ricoledan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-06-06T18:18:49.000Z","updated_at":"2023-06-06T23:09:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"4225d4c2-9625-4e9a-aee8-fc4353365c27","html_url":"https://github.com/Ricoledan/github-api-sls-nodejs","commit_stats":null,"previous_names":["ricoledan/github-api-sls-nodejs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ricoledan/github-api-sls-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ricoledan%2Fgithub-api-sls-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ricoledan%2Fgithub-api-sls-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ricoledan%2Fgithub-api-sls-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ricoledan%2Fgithub-api-sls-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ricoledan","download_url":"https://codeload.github.com/Ricoledan/github-api-sls-nodejs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ricoledan%2Fgithub-api-sls-nodejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33884733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-11-11T22:14:30.797Z","updated_at":"2026-06-03T23:31:12.092Z","avatar_url":"https://github.com/Ricoledan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# github-api-sls-nodejs\n\nThis serverless function uses the octokit.js library and GitHub API to collect data from a list of specified GitHub\nrepositories. It retrieves and counts the number of contributors and releases in the past year for each repository,\nstoring this data in a pandas DataFrame.\n\n## Installation/deployment instructions\n\nDepending on your preferred package manager, follow the instructions below to deploy your project.\n\n\u003e **Requirements**: NodeJS `lts/fermium (v.14.15.0)`. If you're using [nvm](https://github.com/nvm-sh/nvm),\n\u003e run `nvm use` to ensure you're using the same Node version in local and in your lambda's runtime.\n\n### Using NPM\n\n- Run `npm i` to install the project dependencies\n- Run `npx sls deploy` to deploy this stack to AWS\n\n## Test your service\n\nThis template contains a single lambda function triggered by an HTTP request made on the provisioned API Gateway REST\nAPI `/hello` route with `POST` method. The request body must be provided as `application/json`. The body structure is\ntested by API Gateway against `src/functions/hello/schema.ts` JSON-Schema definition: it must contain the `name`\nproperty.\n\n- requesting any other path than `/hello` with any other method than `POST` will result in API Gateway returning a `403`\n  HTTP error code\n- sending a `POST` request to `/hello` with a payload **not** containing a string property named `name` will result in\n  API Gateway returning a `400` HTTP error code\n- sending a `POST` request to `/hello` with a payload containing a string property named `name` will result in API\n  Gateway returning a `200` HTTP status code with a message saluting the provided name and the detailed event processed\n  by the lambda\n\n\u003e :warning: As is, this template, once deployed, opens a **public** endpoint within your AWS account resources. Anybody\n\u003e with the URL can actively execute the API Gateway endpoint and the corresponding lambda. You should protect this\n\u003e endpoint with the authentication method of your choice.\n\n### Locally\n\nIn order to test the hello function locally, run the following command:\n\n- `npx sls invoke local -f info --path src/functions/info/mock.json` if you're using NPM\n\nCheck\nthe [sls invoke local command documentation](https://www.serverless.com/framework/docs/providers/aws/cli-reference/invoke-local/)\nfor more information.\n\n### Remotely\n\nCopy and replace your `url` - found in Serverless `deploy` command output - and `name` parameter in the following `curl`\ncommand in your terminal or in Postman to test your newly deployed application.\n\n```\ncurl --location --request POST 'https://myApiEndpoint/dev/hello' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"name\": \"Frederic\"\n}'\n```\n\n## Template features\n\n### Project structure\n\nThe project code base is mainly located within the `src` folder. This folder is divided in:\n\n- `functions` - containing code base and configuration for your lambda functions\n- `libs` - containing shared code base between your lambdas\n\n```\n.\n├── src\n│   ├── functions               # Lambda configuration and source code folder\n│   │   ├── hello\n│   │   │   ├── handler.ts      # `Hello` lambda source code\n│   │   │   ├── index.ts        # `Hello` lambda Serverless configuration\n│   │   │   ├── mock.json       # `Hello` lambda input parameter, if any, for local invocation\n│   │   │   └── schema.ts       # `Hello` lambda input event JSON-Schema\n│   │   │\n│   │   └── index.ts            # Import/export of all lambda configurations\n│   │\n│   └── libs                    # Lambda shared code\n│       └── apiGateway.ts       # API Gateway specific helpers\n│       └── handlerResolver.ts  # Sharable library for resolving lambda handlers\n│       └── lambda.ts           # Lambda middleware\n│\n├── package.json\n├── serverless.ts               # Serverless service file\n├── tsconfig.json               # Typescript compiler configuration\n├── tsconfig.paths.json         # Typescript paths\n└── webpack.config.js           # Webpack configuration\n```\n\n### 3rd party libraries\n\n- [json-schema-to-ts](https://github.com/ThomasAribart/json-schema-to-ts) - uses JSON-Schema definitions used by API\n  Gateway for HTTP request validation to statically generate TypeScript types in your lambda's handler code base\n- [middy](https://github.com/middyjs/middy) - middleware engine for Node.Js lambda. This template\n  uses [http-json-body-parser](https://github.com/middyjs/middy/tree/master/packages/http-json-body-parser) to convert\n  API Gateway `event.body` property, originally passed as a stringified JSON, to its corresponding parsed object\n- [@serverless/typescript](https://github.com/serverless/typescript) - provides up-to-date TypeScript definitions for\n  your `serverless.ts` service file\n\n### Advanced usage\n\nAny tsconfig.json can be used, but if you do, set the environment variable `TS_NODE_CONFIG` for building the\napplication, eg `TS_NODE_CONFIG=./tsconfig.app.json npx serverless webpack`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricoledan%2Fgithub-api-sls-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricoledan%2Fgithub-api-sls-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricoledan%2Fgithub-api-sls-nodejs/lists"}