{"id":19624870,"url":"https://github.com/hungds99/aws-rt-chat-app","last_synced_at":"2026-06-10T04:31:30.710Z","repository":{"id":179653795,"uuid":"528309468","full_name":"hungds99/aws-rt-chat-app","owner":"hungds99","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-20T01:25:11.000Z","size":1855,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T19:48:02.755Z","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/hungds99.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":"2022-08-24T07:18:03.000Z","updated_at":"2022-09-03T01:56:41.000Z","dependencies_parsed_at":"2023-09-27T15:46:53.418Z","dependency_job_id":"d06fbc01-85a7-40d3-8a4b-93594a82ba1b","html_url":"https://github.com/hungds99/aws-rt-chat-app","commit_stats":null,"previous_names":["hungds99/aws-rt-chat-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hungds99/aws-rt-chat-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungds99%2Faws-rt-chat-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungds99%2Faws-rt-chat-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungds99%2Faws-rt-chat-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungds99%2Faws-rt-chat-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hungds99","download_url":"https://codeload.github.com/hungds99/aws-rt-chat-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungds99%2Faws-rt-chat-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34137570,"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-10T02:00:07.152Z","response_time":89,"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-11T11:39:16.974Z","updated_at":"2026-06-10T04:31:30.695Z","avatar_url":"https://github.com/hungds99.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\ntitle: 'Serverless Framework Node Express API service backed by DynamoDB on AWS'\ndescription: 'This template demonstrates how to develop and deploy a simple Node Express API service backed by DynamoDB running on AWS Lambda using the traditional Serverless Framework.'\nlayout: Doc\nframework: v3\nplatform: AWS\nlanguage: nodeJS\npriority: 1\nauthorLink: 'https://github.com/serverless'\nauthorName: 'Serverless, inc.'\nauthorAvatar: 'https://avatars1.githubusercontent.com/u/13742415?s=200\u0026v=4'\n--\u003e\n\n# Serverless Framework Node Express API on AWS\n\nThis template demonstrates how to develop and deploy a simple Node Express API service, backed by DynamoDB database, running on AWS Lambda using the traditional Serverless Framework.\n\n## Anatomy of the template\n\nThis template configures a single function, `api`, which is responsible for handling all incoming requests thanks to the `httpApi` event. To learn more about `httpApi` event configuration options, please refer to [httpApi event docs](https://www.serverless.com/framework/docs/providers/aws/events/http-api/). As the event is configured in a way to accept all incoming requests, `express` framework is responsible for routing and handling requests internally. Implementation takes advantage of `serverless-http` package, which allows you to wrap existing `express` applications. To learn more about `serverless-http`, please refer to corresponding [GitHub repository](https://github.com/dougmoscrop/serverless-http). Additionally, it also handles provisioning of a DynamoDB database that is used for storing data about users. The `express` application exposes two endpoints, `POST /users` and `GET /user/{userId}`, which allow to create and retrieve users.\n\n## Usage\n\n### Deployment\n\nInstall dependencies with:\n\n```\nnpm install\n```\n\nand then deploy with:\n\n```\nserverless deploy\n```\n\nAfter running deploy, you should see output similar to:\n\n```bash\nDeploying aws-node-express-dynamodb-api-project to stage dev (us-east-1)\n\n✔ Service deployed to stack aws-node-express-dynamodb-api-project-dev (196s)\n\nendpoint: ANY - https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com\nfunctions:\n  api: aws-node-express-dynamodb-api-project-dev-api (766 kB)\n```\n\n_Note_: In current form, after deployment, your API is public and can be invoked by anyone. For production deployments, you might want to configure an authorizer. For details on how to do that, refer to [`httpApi` event docs](https://www.serverless.com/framework/docs/providers/aws/events/http-api/). Additionally, in current configuration, the DynamoDB table will be removed when running `serverless remove`. To retain the DynamoDB table even after removal of the stack, add `DeletionPolicy: Retain` to its resource definition.\n\n### Invocation\n\nAfter successful deployment, you can create a new user by calling the corresponding endpoint:\n\n```bash\ncurl --request POST 'https://xxxxxx.execute-api.us-east-1.amazonaws.com/users' --header 'Content-Type: application/json' --data-raw '{\"name\": \"John\", \"userId\": \"someUserId\"}'\n```\n\nWhich should result in the following response:\n\n```bash\n{\"userId\":\"someUserId\",\"name\":\"John\"}\n```\n\nYou can later retrieve the user by `userId` by calling the following endpoint:\n\n```bash\ncurl https://xxxxxxx.execute-api.us-east-1.amazonaws.com/users/someUserId\n```\n\nWhich should result in the following response:\n\n```bash\n{\"userId\":\"someUserId\",\"name\":\"John\"}\n```\n\nIf you try to retrieve user that does not exist, you should receive the following response:\n\n```bash\n{\"error\":\"Could not find user with provided \\\"userId\\\"\"}\n```\n\n### Local development\n\nIt is also possible to emulate DynamoDB, API Gateway and Lambda locally using the `serverless-dynamodb-local` and `serverless-offline` plugins. In order to do that, run:\n\n```bash\nserverless plugin install -n serverless-dynamodb-local\nserverless plugin install -n serverless-offline\n```\n\nIt will add both plugins to `devDependencies` in `package.json` file as well as will add it to `plugins` in `serverless.yml`. Make sure that `serverless-offline` is listed as last plugin in `plugins` section:\n\n```\nplugins:\n  - serverless-dynamodb-local\n  - serverless-offline\n```\n\nYou should also add the following config to `custom` section in `serverless.yml`:\n\n```\ncustom:\n  (...)\n  dynamodb:\n    start:\n      migrate: true\n    stages:\n      - dev\n```\n\nAdditionally, we need to reconfigure `AWS.DynamoDB.DocumentClient` to connect to our local instance of DynamoDB. We can take advantage of `IS_OFFLINE` environment variable set by `serverless-offline` plugin and replace:\n\n```javascript\nconst dynamoDbClient = new AWS.DynamoDB.DocumentClient();\n```\n\nwith the following:\n\n```javascript\nconst dynamoDbClientParams = {};\nif (process.env.IS_OFFLINE) {\n  dynamoDbClientParams.region = 'localhost';\n  dynamoDbClientParams.endpoint = 'http://localhost:8000';\n}\nconst dynamoDbClient = new AWS.DynamoDB.DocumentClient(dynamoDbClientParams);\n```\n\nAfter that, running the following command with start both local API Gateway emulator as well as local instance of emulated DynamoDB:\n\n```bash\nserverless offline start\n```\n\nTo learn more about the capabilities of `serverless-offline` and `serverless-dynamodb-local`, please refer to their corresponding GitHub repositories:\n\n- https://github.com/dherault/serverless-offline\n- https://github.com/99x/serverless-dynamodb-local\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhungds99%2Faws-rt-chat-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhungds99%2Faws-rt-chat-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhungds99%2Faws-rt-chat-app/lists"}