diff --git a/README.md b/README.md index e966d0d..4a679ce 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ You can enter the example for information about "How to run" - [hlog:](hlog) Example of using hlog and its log extension - [trailer:](trailer) Example of read/write trailers for hertz server - [graphql-go:](graphql-go) Example of using graphql in hertz server - +- [embed](embed) Example of embed static web resources. ## Client diff --git a/README_CN.md b/README_CN.md index 35861d6..5fb77d6 100644 --- a/README_CN.md +++ b/README_CN.md @@ -65,6 +65,7 @@ - [reverseproxy:](reverseproxy) 在 hertz server 中使用反向代理的示例 - [hlog:](hlog) 使用 hlog 以及其日志拓展的示例 - [graphql-go:](graphql-go) 在 hertz server 中使用 graphql 的示例 +- [embed](embed) 在hertz中使用embed打包静态web资源 ## Client diff --git a/embed/README.md b/embed/README.md new file mode 100644 index 0000000..4321e08 --- /dev/null +++ b/embed/README.md @@ -0,0 +1,8 @@ +# embed + +## embed static web resources in hertz +- You can check the code [main.go](main.go) +- Start the server, and you can request the route: + - `localhost:8888/` you will see: embed static web resources + - `localhost:8888/test/test1.txt` you will see: test1 + - `localhost:8888/test/test2.txt` you will see: test2 \ No newline at end of file diff --git a/embed/index.html b/embed/index.html new file mode 100644 index 0000000..06f5047 --- /dev/null +++ b/embed/index.html @@ -0,0 +1,13 @@ + + +
+ + + +