From 2a47af33c0037a5dab72af1340ba890818eecc7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=8A=E6=96=87=E9=BE=99?= Date: Fri, 16 Apr 2021 00:06:31 +0800 Subject: [PATCH] Add README file for http & helloworld examples (#839) * Add readme for helloworld example. * Add readme file for http example. --- examples/helloworld/README.md | 10 ++++++++++ examples/http/README.md | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 examples/helloworld/README.md create mode 100644 examples/http/README.md diff --git a/examples/helloworld/README.md b/examples/helloworld/README.md new file mode 100644 index 000000000..be39d4fee --- /dev/null +++ b/examples/helloworld/README.md @@ -0,0 +1,10 @@ +# Run the example + +1、Compile and execute the server code: +```shell +$ go run server/main.go +``` +2、From a different terminal, compile and execute the client code: +```shell +$ go run client/main.go +``` \ No newline at end of file diff --git a/examples/http/README.md b/examples/http/README.md new file mode 100644 index 000000000..1c2df5536 --- /dev/null +++ b/examples/http/README.md @@ -0,0 +1,33 @@ +# 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 +``` \ No newline at end of file