Skip to content

anderolimar/users-api

Repository files navigation

users-api

User REST API to perform CRUD operations.

This api uses GO as programming language e Docker as container.

The database for this api is MongoDB.

All settings are done through Environment Variables.

User Api


Requirements

Go 1.18
Docker
Docker Composer
Swag


Configurations


Environment variables :

Variable Description Default Value
PORT Server port 3000
MONGODB_URI Mongo DB Uri connection
MONGODB_DATABASE Mongo database name
RATE_LIMIT Rate limit value 1
RATE_LIMIT_TOKENS Rate limit tokens value 5
API_USER Api Basic auth user apiuser
API_PASS Api Basic auth password apipass

Generate API swagger documentation


This API Documentation is generate using swagger.

Execute the command below :

$ make swag

Running API Local


Run api envorinment locally with docker-compose

Execute the command below :

$ make envup

Finishing API Local


Finish api envorinment locally with docker-compose

Execute the command below :

$ make envdown

API Documentation URL


Access the URL below :

http://localhost:3000/doc/index.html


Running Tests


Execute the command below :

$ make test

Technical Debts


  • Implement logs structure
  • Improve API Auth
  • Configure CORS to api
  • Implement Code Coverage

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published