Skip to content

This code will quickly generate Login and Registration API using API gateway, lambda and dynamodb

Notifications You must be signed in to change notification settings

BelalH/serverless-simple-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

serverless-simple-auth

This code will quickly generate Login and Registration API using API gateway, lambda and dynamodb

The serverless code is going to create dynamodb, lambda and API gateway

Functions:

  • Register: allow users to send their username and password saving them in Dynamodb after hashing the password, return a JWT token as a response
  • login: match username and password with the user in dynamodb, return JWT token as a response
  • Me: used as an example to test the JWT token to check, return user information
  • Validate Token: a function that API Gateway will automatically call the check if the token is valid or not

Add serverless library

npm install serverless -g

Install dependencies

npm install

Deploy your code

alt text

Applying this blog implementation, adding Dynamodb as the main DB instead of MongoDB

About

This code will quickly generate Login and Registration API using API gateway, lambda and dynamodb

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published