Skip to content

Aws Lambda Serverless Skeleton Node - Boilerplate to build simple lambda functions with RESTful API

License

Notifications You must be signed in to change notification settings

prafed/aws-lambda-serverless-skeleton-node

 
 

Repository files navigation

Aws Node Lambda Serverless Skeleton

Boilerplate to build simple lambda functions with RESTful API

Purpose

This project can be used for everyone to create lambda functions containing APIs with RESTful. It are build with aws-express.

Last updates

In this section contains the release notes of the project.

Version 0.0.1

Initial version of the project

All the changes must be tracked in CHANGELOG.md

Prerequisites

  • node: 6.10+
  • aws-sdk
  • aws-serverless-express
  • node-cache
  • uuid

development

  • nodemon
  • jest

Features

  • Provides an structure for lambda function environment.

Installation

The first step is the installation of Node.js, even though it is not installed. The installation is done using the command npm

npm install 

The Development dependencies can be installed by this command:

npm install --only=dev

Getting started

Running locally for testing and development

This application are build for Aws Lambda functions, but to run locally this application uses the express module. To run the application locally you need execute the follow command:

node server.js 

Or via npm:

npm server

Running tests

To run the unit tests of the project you can execute the follow command:

npm test

Usage

Open the browser of your preference and go to localhost:3000.

After change the url to:

Response:

{
    "result": true,
    "message": "Person list success",
    "data": [
        {
            "uuid": "1da3c840-d688-11e9-a1e2-ff2b6767f962",
            "firstName": "João",
            "lastName": "Silva",
            "email": "[email protected]",
            "photo": "",
            "deleted": "0",
            "active": "1",
            "createdAt": "2019-09-14T00:39:31.268Z",
            "updatedAt": null,
            "deletedAt": null
        },
        {
            "uuid": "1da41660-d688-11e9-a1e2-ff2b6767f962",
            "firstName": "Maria",
            "lastName": "Silva",
            "email": "[email protected]",
            "photo": "",
            "deleted": "0",
            "active": "1",
            "createdAt": "2019-09-14T00:39:31.270Z",
            "updatedAt": null,
            "deletedAt": null
        }
    ]
}

There is an example of an API response using a cache memory only for this demonstration, you can apply an dynamoDB or other DB of you preference.

License

Code released under the LICENSE

Contributors

Contributions

Pull requests and new issues are welcome. See CONTRIBUTING.md for details.

About

Aws Lambda Serverless Skeleton Node - Boilerplate to build simple lambda functions with RESTful API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%