1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-14 02:33:03 +02:00
kratos/examples/http
2021-11-04 22:07:01 +08:00
..
cors fix(examples/cors): method misuse (#1184) 2021-07-14 13:05:15 +08:00
echo fix: examples lint error (#1454) 2021-09-09 20:45:08 +08:00
errors fix: examples lint error (#1454) 2021-09-09 20:45:08 +08:00
gin refactor: move plugins to contrib dir (#1399) 2021-09-01 13:40:14 +08:00
middlewares add router group for http server (#1208) 2021-07-18 20:12:20 +08:00
mux examples: clean examples (#1036) 2021-06-12 20:20:18 +08:00
static examples: clean examples (#1036) 2021-06-12 20:20:18 +08:00
upload fix: examples lint error (#1454) 2021-09-09 20:45:08 +08:00
README.md make the output of gin example right (#1598) 2021-11-04 22:07:01 +08:00

Run the examples

gin

1、Compile and execute the server code:

$ go run gin/main.go

2、From a different terminal, access the api to see the output:

$ curl http://127.0.0.1:8000/helloworld/gin
{"welcome":"gin"}

mux

1、Compile and execute the server code:

$ go run mux/main.go

2、From a different terminal, access the api to see the output:

$ curl http://127.0.0.1:8000/home
Hello Gorilla Mux!

static

1、Compile and execute the server code:

$ go run static/main.go

2、Access the following url with your browser:

http://127.0.0.1:8000/assets