You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
630 B
33 lines
630 B
# Run the examples
|
|
|
|
## gin
|
|
1、Compile and execute the server code:
|
|
```shell
|
|
$ go run gin/main.go
|
|
```
|
|
2、From a different terminal, access the api to see the output:
|
|
```shell
|
|
$ curl http://127.0.0.1:8000/helloworld/gin
|
|
{"welcome":"gin"}
|
|
```
|
|
|
|
## mux
|
|
1、Compile and execute the server code:
|
|
```shell
|
|
$ go run mux/main.go
|
|
```
|
|
2、From a different terminal, access the api to see the output:
|
|
```shell
|
|
$ curl http://127.0.0.1:8000/home
|
|
Hello Gorilla Mux!
|
|
```
|
|
|
|
## static
|
|
1、Compile and execute the server code:
|
|
```shell
|
|
$ go run static/main.go
|
|
```
|
|
2、Access the following url with your browser:
|
|
```
|
|
http://127.0.0.1:8000/assets
|
|
```
|
|
|