https://github.com/anjasfedo/go-mongo
RESTful API Golang with MongoDB
https://github.com/anjasfedo/go-mongo
golang learning-by-doing mongodb restful-api
Last synced: 10 months ago
JSON representation
RESTful API Golang with MongoDB
- Host: GitHub
- URL: https://github.com/anjasfedo/go-mongo
- Owner: Anjasfedo
- Created: 2024-01-13T12:23:13.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-13T16:56:20.000Z (almost 2 years ago)
- Last Synced: 2025-01-17T03:28:19.491Z (12 months ago)
- Topics: golang, learning-by-doing, mongodb, restful-api
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GoLang RESTful API with MongoDB 🚀
This project is a simple RESTful API built using GoLang with MongoDB.
## Getting Started🛠️
Follow these steps to run the project locally:
1. **Start the Server:**
```bash
go run main.go
```
The server will start at http://localhost:8000.
## API Endpoints🚪
### Get Users
- **Endpoint:** `GET /user`
- **Description:** Retrieve a list of all users.
### Get User by ID
- **Endpoint:** `GET /user/:id`
- **Description:** Retrieve a specific user by ID.
### Create User
- **Endpoint:** `POST /user`
- **Description:** Create a new user.
### Update User by ID
- **Endpoint:** `PUT /user/:id`
- **Description:** Update a specific user by ID.
### Delete User by ID
- **Endpoint:** `DELETE /user/:id`
- **Description:** Delete a specific user by ID.
The API Postman Collection is available in the /postman-collection/ directory.
## Dependencies📦
- [httprouter](https://github.com/julienschmidt/httprouter): HTTP request router
- [mgo](https://gopkg.in/mgo.v2): MongoDB driver for Go
## Closing Notes📝
If you find any issues or have suggestions for improvement, please feel free to open an issue or submit a pull request.
Happy coding!🚀👨💻