mirror of
https://github.com/gin-gonic/gin.git
synced 2026-07-06 18:31:24 +08:00
Merge b758ec4717db96c513005a345ff95359754be9fa into d9307dbcbbe796a64d9e0ef23452da888dd7f904
This commit is contained in:
commit
b94fd9b2f8
13
README.md
13
README.md
@ -92,14 +92,21 @@ func main() {
|
|||||||
**Running the application:**
|
**Running the application:**
|
||||||
|
|
||||||
1. Save the code above as `main.go`
|
1. Save the code above as `main.go`
|
||||||
2. Run the application:
|
2. Initialize a Go module and download dependencies:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
go mod init example.com/gin-quickstart
|
||||||
|
go mod tidy
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Run the application:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
go run main.go
|
go run main.go
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Open your browser and visit [`http://localhost:8080/ping`](http://localhost:8080/ping)
|
4. Open your browser and visit [`http://localhost:8080/ping`](http://localhost:8080/ping)
|
||||||
4. You should see: `{"message":"pong"}`
|
5. You should see: `{"message":"pong"}`
|
||||||
|
|
||||||
**What this example demonstrates:**
|
**What this example demonstrates:**
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user