Skip to content

Commit 99e4c4d

Browse files
Update README.md
1 parent 57c912b commit 99e4c4d

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,43 @@
11
# go-mongo-server
22
Connect Go driver with MongoDB
3+
4+
## Writing a basic HTTP server is easy using Gin package mongo connect
5+
6+
# To run http server
7+
8+
9+
```
10+
for gin
11+
12+
git clone https://github.com/vinodnextcoder/go-mongo-server.git
13+
you go directory install package and run code
14+
15+
cd go-mongo-server
16+
17+
Install Gin:
18+
go get github.com/gin-gonic/gin
19+
go get go.mongodb.org/mongo-driver/mongo
20+
go get github.com/joho/godotenv
21+
go get github.com/swaggo/files
22+
go get github.com/swaggo/gin-swagger
23+
go install github.com/swaggo/swag/cmd/swag@latest
24+
swag init
25+
26+
You can run your Gin web application by executing the main.go file:
27+
28+
go run main.go
29+
30+
````
31+
# to call api endpoint in postman
32+
33+
```
34+
http://localhost:3000
35+
36+
```
37+
38+
# You can go to swagger doc
39+
40+
```
41+
http://localhost:3001/swagger/index.html
42+
```
43+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy