Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vinodnextcoder/go-mongo-server
Connect Go driver with MongoDB
https://github.com/vinodnextcoder/go-mongo-server
gin-gonic gin-gonic-mongo go-api go-backend go-gin go-mongo golang-crud golang-mongo-api golang-mongodb mongo-go-driver mongodb simple-golang-api
Last synced: about 1 month ago
JSON representation
Connect Go driver with MongoDB
- Host: GitHub
- URL: https://github.com/vinodnextcoder/go-mongo-server
- Owner: vinodnextcoder
- License: mit
- Created: 2024-01-18T06:07:42.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-01-23T09:15:55.000Z (11 months ago)
- Last Synced: 2024-01-24T08:58:10.288Z (11 months ago)
- Topics: gin-gonic, gin-gonic-mongo, go-api, go-backend, go-gin, go-mongo, golang-crud, golang-mongo-api, golang-mongodb, mongo-go-driver, mongodb, simple-golang-api
- Language: Go
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-mongo-server
Connect Go driver with MongoDB## Writing a basic HTTP server is easy using Gin package mongo connect
# To run http server
```
for gingit clone https://github.com/vinodnextcoder/go-mongo-server.git
you go directory install package and run codecd go-mongo-server
Install Gin:
go get github.com/gin-gonic/gin
go get go.mongodb.org/mongo-driver/mongo
go get github.com/joho/godotenv
go get github.com/swaggo/files
go get github.com/swaggo/gin-swagger
go install github.com/swaggo/swag/cmd/swag@latest
swag initYou can run your Gin web application by executing the main.go file:
go run main.go
````
# postman collection import
from go-mongo-server/postman_collection
# to call api endpoint in postman```
http://localhost:3000```
# You can go to swagger doc
```
http://localhost:3001/swagger/index.html
```