Go html boilerplate

用 Go 进行 web 开发的入门包。「Starter pack for doing web development in Go」

Github星跟蹤圖

Go html boilerplate

This is a starter pack for doing web development with Go, with support
for some of the things you'll usually want to add to an HTML web server:

  • Adding templates and rendering them
  • Regex matching for routes
  • Logging requests and responses
  • Serving static content with caching/busting
  • Watching/restarting the server after changes to CSS/templates
  • Loading configuration from a config file
  • Flash success and error messages

Read more about the choices and the feature set found here. You can see
an example project using go-html-boilerplate here
.

Feel free to adapt the project as you see fit; that should be pretty easy to
do since no one component does too much on its own, and all of them operate on
standard library interfaces like http.Handler.

To get started, run go get ./... and then make serve to start a server on
port 7065. You may need to run make generate_cert to generate a self-signed
certificate for local use.

Templates go in the "templates" folder; you can see how they're loaded by
examining the init function in main.go. Run make assets to recompile them
into the binary.

Static files go in the "static" folder. Run make assets to recompile them into
the binary.

Watching for changes

Run make watch to restart the server after you make changes to the assets
directory.

If you are on a Mac, be sure to add this folder to the Spotlight privacy
list
, or file modify events will fire a second time when Spotlight indexes
updates
.

主要指標

概覽
名稱與所有者kevinburke/go-html-boilerplate
主編程語言Go
編程語言Makefile, Go, CSS, HTML (語言數: 4)
平台
許可證MIT License
所有者活动
創建於2017-03-31 20:12:41
推送於2024-06-03 19:20:44
最后一次提交2024-06-03 12:20:29
發布數8
最新版本名稱v0.8.0 (發布於 )
第一版名稱0.1 (發布於 2017-04-09 18:54:24)
用户参与
星數0
關注者數2
派生數0
提交數65
已啟用問題?
問題數8
打開的問題數5
拉請求數0
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?