Skip to content

Latest commit

 

History

History
90 lines (55 loc) · 1.31 KB

README.md

File metadata and controls

90 lines (55 loc) · 1.31 KB

CRUD API >> Go Fiber v2

Requirements:

  • 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

Installation and Configuration

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. ⛳️

Be Ready/Install:

go mod tidy

Run:

go run main.go

API Endpoint:

POST /users
GET /users
Get /users/:id
PUT /users/:id
DELETE /users/:id

# try the api with postman
# port 3000

🎯 I know, you liked it.

🧑‍💻 Stay in touch

tada! 🎉