Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oppodelldog/go-simple-webapp-template
https://github.com/oppodelldog/go-simple-webapp-template
assets gorilla logrus mux template webapp
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/oppodelldog/go-simple-webapp-template
- Owner: Oppodelldog
- License: mit
- Created: 2019-02-19T19:56:30.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-04-26T21:54:55.000Z (8 months ago)
- Last Synced: 2024-06-20T13:30:22.822Z (7 months ago)
- Topics: assets, gorilla, logrus, mux, template, webapp
- Language: Go
- Size: 21.5 KB
- Stars: 7
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go simple webapp template
This template is intended to show how one can easily setup
a tls encrypted webserver in go including routing, html templating and assets.Finally all resources are compiled into the binary, to be ready to deploy.
As you can see from the go.mod file there are some third party dependencies
bound to this project.Here are some reasons why I prefer to use them.
## Routing (gorilla mux)
As router I chosse the gorilla.mux, which is pretty famous.
**https://github.com/gorilla/mux**It is easy to use, allows short, expressive configuration and has
good regular expression support for route parameters.## Assets
Assets are embedded into the built binary at compile time using go standard library package "embed".## Logging (logrus)
The reasons for logrus are pretty straight forward.
I like it ...it has colors ... sometimes.... and ... it's used by docker!! ;-)
No, seriously. I've seen it can be used in production for logging to syslog,logstash and more.## Getting started
* call ```make build```
* You will find the server binary in **.build-assets**### local dev
For local development I suggest to use the **.env** file
which sets the assets to be load from local filesystem instead
of looking in the generated go files.