diff options
author | Markus Wüstenberg | 2024-09-19 21:45:31 +0200 |
---|---|---|
committer | GitHub | 2024-09-19 21:45:31 +0200 |
commit | 12acb8041060306b361109b46f9f05dbb4382ea0 (patch) | |
tree | 469f06f059809b6c606ff2e489896dec47a546a8 /internal/examples/app/http/server.go | |
parent | 69b0da41dff1813f3939cf4ea09fbbb2d06b7719 (diff) | |
download | gomponents-12acb8041060306b361109b46f9f05dbb4382ea0.tar.lz gomponents-12acb8041060306b361109b46f9f05dbb4382ea0.tar.zst gomponents-12acb8041060306b361109b46f9f05dbb4382ea0.zip |
Add full example app (#204)
Also, remove the other examples and simplify the readme.
Diffstat (limited to 'internal/examples/app/http/server.go')
-rw-r--r-- | internal/examples/app/http/server.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/examples/app/http/server.go b/internal/examples/app/http/server.go new file mode 100644 index 0000000..8264fcf --- /dev/null +++ b/internal/examples/app/http/server.go @@ -0,0 +1,18 @@ +package http + +import ( + "net/http" +) + +func Start() error { + return http.ListenAndServe(":8080", setupRoutes()) +} + +func setupRoutes() http.Handler { + mux := http.NewServeMux() + + Home(mux) + About(mux) + + return mux +} |