Skip to content

Latest commit

 

History

History
127 lines (88 loc) · 1.61 KB

README.md

File metadata and controls

127 lines (88 loc) · 1.61 KB

Fastify Serverless Spike SSO

Stack:

  • NodeJs
  • Fastify
  • Serverless Framework
  • Tap
  • Eslint
  • Prettier
  • Husky

Commands

Install DynamoDB local

Requsities

  • Java
npm run dynamodb:install

Start serverless offline

Start serverless in offline mode (use only for development and testing purposes)

npm run offline
npm run dynamodb:start:dev

after that you can use the following command to stop dynamodb

npm run dynamodb:kill

You can open DynamoDB Admin UI using the command:

npm run dynamodb:admin

Testing

Launch tests

npm run test

Launch tests with coverage

npm run test:coverage

Launch tests with filter

npm run test:filter --filter=<filter>

Linting and Formatting

Check linting

npm run lint

Fix linting

npm run lint:fix

Format code

npm run format

Pre-commit hook

npm run precommit:init

then copy the content of pre-commit.dist into .husky/pre-commit

Use Cases

Health Check

curl --location 'https://<app-url>/api/health/'

should return

{
  "status": "ok"
}

Swagger

You can find the swagger documentation at the following url:

https://<app-url>/api/documentation
local: http://localhost:3000/dev/documentation/static/index.html

Set up Google authentication in local environment

  • Create .env file in project root folder
  • Add to .env file
    GOOLE_CLIENT_ID=XXX
    GOOLE_CLIENT_SECRET=XXX
    
  • Replace XXX with your google client id and secret