1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-26 03:52:12 +02:00
kratos/examples/http/README.md
伊文龙 2a47af33c0
Add README file for http & helloworld examples (#839)
* Add readme for helloworld example.

* Add readme file for http example.
2021-04-16 00:06:31 +08:00

33 lines
612 B
Markdown

# 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/home
Hello 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
```