Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
vinod edited this page Jan 18, 2024 · 2 revisions

Writing a basic HTTP server is easy using Gin package mongo connect

To run http server

for gin

git clone https://github.com/vinodnextcoder/go-mongo-server.git
 you go directory install package and run code

cd 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 init

You can run your Gin web application by executing the main.go file:

go run main.go

to call api endpoint in postman

http://localhost:3000

You can go to swagger doc

http://localhost:3001/swagger/index.html
Morty Proxy This is a proxified and sanitized view of the page, visit original site.