https://github.com/devsazal/go-crud-api
an experimental crud operation rest apis with GO, Fiber (v2.x), MongoDB
https://github.com/devsazal/go-crud-api
crud fiber fiber-framework go golang mongodb rest-api
Last synced: about 1 month ago
JSON representation
an experimental crud operation rest apis with GO, Fiber (v2.x), MongoDB
- Host: GitHub
- URL: https://github.com/devsazal/go-crud-api
- Owner: DevSazal
- Created: 2023-05-26T23:40:58.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-10T16:38:32.000Z (about 3 years ago)
- Last Synced: 2025-07-20T02:01:53.509Z (11 months ago)
- Topics: crud, fiber, fiber-framework, go, golang, mongodb, rest-api
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CRUD API >> Go Fiber v2
### Requirements:
* Go
* Fiber [v2.x](https://docs.gofiber.io/)
* 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](https://go.dev/).
- `.env.example` - a sample of .env which can be helpful for configuration.
```bash
# 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:
```bash
PORT=3000
MONGO_URI=''
```
Already done? Cool! You are almost ready to enjoy the app. ⛳️
### Be Ready/Install:
```
go mod tidy
```
### Run:
```bash
go run main.go
```
### API Endpoint:
```bash
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
- Author - [Sazal Ahamed](https://sazal.vercel.app)
#### tada! 🎉