Skip to content

an experimental crud operation rest apis with GO, Fiber (v2.x), MongoDB

Notifications You must be signed in to change notification settings

DevSazal/go-crud-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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! πŸŽ‰

About

an experimental crud operation rest apis with GO, Fiber (v2.x), MongoDB

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages