{"id":18123327,"url":"https://github.com/mhadaily/serveless-nodejs-aws","last_synced_at":"2026-05-01T08:32:16.465Z","repository":{"id":74805238,"uuid":"81446045","full_name":"mhadaily/Serveless-Nodejs-AWS","owner":"mhadaily","description":"A simple microservice with Serverless(Node.js),Lambda, CloudWatch,S3 and Angular2 for client-side","archived":false,"fork":false,"pushed_at":"2017-06-02T15:23:40.000Z","size":634,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T12:48:17.367Z","etag":null,"topics":["angular2","aws","aws-lambda","aws-s3","microservices","nodejs","serverless","tutorials"],"latest_commit_sha":null,"homepage":"","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/mhadaily.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":"2017-02-09T12:03:14.000Z","updated_at":"2022-12-07T08:45:20.000Z","dependencies_parsed_at":"2026-02-21T02:26:10.545Z","dependency_job_id":null,"html_url":"https://github.com/mhadaily/Serveless-Nodejs-AWS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mhadaily/Serveless-Nodejs-AWS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhadaily%2FServeless-Nodejs-AWS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhadaily%2FServeless-Nodejs-AWS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhadaily%2FServeless-Nodejs-AWS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhadaily%2FServeless-Nodejs-AWS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhadaily","download_url":"https://codeload.github.com/mhadaily/Serveless-Nodejs-AWS/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhadaily%2FServeless-Nodejs-AWS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32490810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["angular2","aws","aws-lambda","aws-s3","microservices","nodejs","serverless","tutorials"],"created_at":"2024-11-01T07:09:17.521Z","updated_at":"2026-05-01T08:32:16.444Z","avatar_url":"https://github.com/mhadaily.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless - Amazon Web service - NodeJs micro services\n\nThis purpose of this project is to show how Node.js micro services works with Amazon webservice. \nI will update this repository with a tutorial that shows \nhow you are able to easily create a micro-service and setup that in Lambda and working with other services in AWS. \n\n*** [Angular Demo of Search an Comment and return response from Lambda](https://www.majidhajian.com/Serveless-Nodejs-AWS/)***\n\n#### Angular project is under Client folder \n\n## Development Requirement\n \nbefore any steps, make sure you are in `serverless` folder, then :\n \n  1. install serverless `npm install serverless -g` \n  2. install dependencies `npm install` or alternatively use Yarn `yarn install`\n  3. you need to setup AWS credentials as easy as `sls config credentials --provider aws --key [you-key] --secrect [you-secrect]`. The goal is to \n  setup key and secret key if you are happy with other ways, do it then. \n  4. `serverless invoke local -f [function name]` sls is short command of serverless you may want to use it.\n  5. send your variables with event.json, for more information read [serverless documentation](https://serverless.com/framework/docs/). \n  \n## Deployment \n\nIn order to deploy the function simply run\n\n````commandline\nserverless deploy\n```` \n\nif all goes ok then you should see API endpoint as well as other information. \n\n## Usage\nIn `serverless.yml` a function which is `comment` will have a GET endpoint to receive data from a third-party. Then it will create\nall information to a file with `uuid` name and save it in /tmp/ folder in Lambda. Then, that file will be uploaded to S3 under\n`brandlab-inbox` bucket which has a subfolder `comments`. \n\nAs soon as, any file is created in `comments\\*.json`, commentParse which is another Lambda function will be triggered and \nthat particular file will be parsed and will be sent to CloudWatch with the following Metrics. \n\n### Sample Return JSON \n\nsample of return message after calling GET with an id=71\n\n````json\n{\n    \"message\":\"Successfully uploaded data to S3\",\n    \"body\":{  \n       \"postId\":15,\n       \"id\":71,\n       \"name\":\"vel pariatur perferendis vero ab aut voluptates labore\",\n       \"email\":\"Lavinia@lafayette.me\",\n       \"body\":\"mollitia magnam etnipsum consequatur est expeditanaut rem ut ex doloremque est vitae estncumque velit recusandae numquam libero dolor fuga fugit a\"\n    }\n}\n````\n\n## Logs\n\nTo verify that our event was forwarded to our log-function run\n\n````commandline\nserverless logs -f comments\n````\n\nThe expected result should be similar to:\n````commandline\nSTART RequestId: 6155317e-f028-11e6-b22c-51eaabd15d33 Version: $LATEST\n2017-02-11 15:04:51.563 (+08:00)        6155317e-f028-11e6-b22c-51eaabd15d33    Successfully uploaded data to S3\n2017-02-11 15:04:51.579 (+08:00)        6155317e-f028-11e6-b22c-51eaabd15d33    Temp File Delete\nEND RequestId: 6155317e-f028-11e6-b22c-51eaabd15d33\nREPORT RequestId: 6155317e-f028-11e6-b22c-51eaabd15d33  Duration: 660.13 ms     Billed Duration: 700 ms         Memory Size: 1024 MB    Max Memory Used: 35 MB  \n````\nyou can see which file name has been uploaded to S3 and then that file been deleted from /tmp/.\n\n\n````commandline\nserverless logs -f commentParse\n````\n\nand the expected result should be similar to:\n````commandline\nSTART RequestId: 33c29257-f02e-11e6-8638-f9075e0278ef Version: $LATEST\n2017-02-11 15:46:31.809 (+08:00)        33c29257-f02e-11e6-8638-f9075e0278ef    HAS BEEN READ FROM S3:  {\"postId\":11,\"id\":54,\"name\":\"culpa eius tempora sit consequatur neque iure deserunt\",\"email\":\"Kenton_Vandervort@friedrich.com\",\"body\":\"et ipsa rem ullam cum pariatur similique quia\\ncum ipsam est sed aut inventore\\nprovident sequi commodi enim inventore assumenda aut aut\\ntempora possimus soluta quia consequatur modi illo\"}\nEND RequestId: 33c29257-f02e-11e6-8638-f9075e0278ef\nREPORT RequestId: 33c29257-f02e-11e6-8638-f9075e0278ef  Duration: 128.54 ms     Billed Duration: 200 ms         Memory Size: 1024 MB    Max Memory Used: 33 MB  \n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhadaily%2Fserveless-nodejs-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhadaily%2Fserveless-nodejs-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhadaily%2Fserveless-nodejs-aws/lists"}