- Go
- Fiber v2.x
- Git
- MongoDB
Let's clone the repository on your machine.
π The application includes the following files and folders.
app
- code for the application written in Go..env.example
- a sample of .env which can be helpful for configuration.
# architecture
# deep drive in app directory
app/
βββ handlers/
β βββ user.handler.go
βββ models/
β βββ user.go
βββ repositories/
β βββ user.repository.go
βββ services/
β βββ user.service.go
βββ utils/
βββ response.go
Let's move to the cloned directory with your terminal.
Let's rename from .env.example
to .env
and make sure all the necessary information is correct:
PORT=3000
MONGO_URI=''
Already done? Cool! You are almost ready to enjoy the app. β³οΈ
go mod tidy
go run main.go
POST /users
GET /users
Get /users/:id
PUT /users/:id
DELETE /users/:id
# try the api with postman
# port 3000
- Author - Sazal Ahamed