1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-07 23:02:12 +02:00
kratos/examples/http
Tony Chen 8c26c8c328
examples: add cors example (#1048)
* add cors example
2021-06-13 15:21:29 +08:00
..
cors examples: add cors example (#1048) 2021-06-13 15:21:29 +08:00
gin examples: clean examples (#1036) 2021-06-12 20:20:18 +08:00
middlewares transport/http: add vars to http context (#1037) 2021-06-12 22:21:54 +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 examples: clean examples (#1036) 2021-06-12 20:20:18 +08:00
README.md Add README file for http & helloworld examples (#839) 2021-04-16 00:06:31 +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/home
Hello 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