Fiber is an Express.js inspired web framework build on top of Fasthttp, the fastest HTTP engine for Go. Designed to ease things up for fast development with zero memory allocation and performance in mind.
- github.com/swaggo/swag for auto-generating Swagger API docs
- github.com/securego/gosec for checking Go security issues
- github.com/go-critic/go-critic for checking Go the best practice issues
- github.com/golangci/golangci-lint for checking Go linter issues
Run project by this command:
Use vscode launcher and play with Launch local
you may need to place an api-key on the env of launch.json file.
Minor tests are present. For testing run go test inside routes folder.
| Name | Version | Type |
|---|---|---|
| gofiber/fiber | v2.34.0 |
core |
| arsmn/fiber-swagger | v2.31.1 |
middleware |
| stretchr/testify | v1.7.1 |
tests |
| joho/godotenv | v1.4.0 |
config |
| IBM/cloudant-go-sdk | v0.2.1 |
database |
| swaggo/swag | v1.8.2 |
utils |
| google/uuid | v1.3.0 |
utils |
| go-playground/validator | v10.10.0 |
utils |
Go to API Docs page (Swagger): 127.0.0.1:4555/swagger/index.html
Folder with business logic only. This directory doesn't care about what database driver you're using or which caching solution your choose or any third-party things.
./app/controllersfolder for functional controllers (used in routes)./app/modelsfolder for describe business models and methods of your project./app/queriesfolder for describe queries for models of your project
Folder with API Documentation. This directory contains config files for auto-generated API Docs by Swagger.
Folder with project-specific functionality. This directory contains all the project-specific code tailored only for your business use case, like configs, middleware, routes or utils.
./pkg/configsfolder for configuration functions./pkg/middlewarefolder for add middleware (Fiber built-in and yours)./pkg/repositoryfolder for describeconstof your project./pkg/routesfolder for describe routes of your project./pkg/utilsfolder with utility functions (server starter, error checker, etc)
Folder with platform-level logic. This directory contains all the platform-level logic that will build up the actual project, like setting up the database or cache server instance and storing migrations.
./platform/databasefolder with database setup functions (by default, Cloudant)
#
# Stage status to start server:
# - "dev", for start server without graceful shutdown
# - "prod", for start server with graceful shutdown
STAGE_STATUS="dev"
# Server settings:
SERVER_HOST="0.0.0.0"
SERVER_PORT=5000
SERVER_READ_TIMEOUT=60
# AUTH settings:
API-KEY=2a855350-40b2-4598-b937-3ad5824f8ac4
# Database settings:
CLOUDANT_APIKEY=#create your db (or request to use mine?)
CLOUDANT_URL=https://a273a6f7-77f4-43eb-88ef-58fb17fbeca0-bluemix.cloudantnosqldb.appdomain.cloud