ŽŠŽeljko Ševićinzsevic.hashnode.dev·Mar 29, 2023 · 3 min readDocumenting REST APIs with OpenAPI specs (NestJS/Swagger)OpenAPI is a language-agnostic specification for declaring API documentation for REST APIs. It contains the following information: API information like title, description, version endpoints definitions with request and response parameters DTOs and...00
ŽŠŽeljko Ševićinzsevic.hashnode.dev·Mar 8, 2023 · 2 min readState management with Next.js and ReactThe global state can be helpful when components share some common parts. Also, some parts can stay persistent (in local storage) and be used in the following user's session. React provides a native way to handle state management using context with th...00
ŽŠŽeljko Ševićinzsevic.hashnode.dev·Mar 7, 2023 · 1 min readPostgres and Redis container services for e2e tests in GitHub actionsEnd-to-end tests should use a real database connection, and provisioning container service for the Postgres database can be automated using GitHub actions. The environment variable for the connection string for the newly created database can be set i...00
ŽŠŽeljko Ševićinzsevic.hashnode.dev·Mar 5, 2023 · 2 min readRedis as custom storage for NestJS rate limiterA rate limiter is a standard protection technique against brute force and DDoS attacks. NestJS provides a module for it, and the default storage is in-memory. Custom storage, Redis in this case, should be injected inside ThrottlerModule configuration...00
ŽŠŽeljko Ševićinzsevic.hashnode.dev·Mar 4, 2023 · 3 min readDeploying Node.js apps to HerokuThis post covers the main notes from setting up the Heroku CLI tool to CI/CD pipeline with Github actions. Prerequisites Run the following command to install the CLI tool curl https://cli-assets.heroku.com/install.sh | sh Create an account or log...00