1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

feat: embed assets into binary

Resolves #26
This commit is contained in:
Steven Tang
2021-01-22 23:50:46 +11:00
parent a3d8c4d464
commit 4e6e665e19
7 changed files with 44 additions and 46 deletions

View File

@@ -1,8 +1,11 @@
package main
//go:generate $GOPATH/bin/pkger -include /version.txt -include /static -include /data -include /migrations/common/fixtures -include /views
import (
"fmt"
"github.com/gorilla/handlers"
"github.com/markbates/pkger"
conf "github.com/muety/wakapi/config"
"github.com/muety/wakapi/migrations/common"
"github.com/muety/wakapi/repositories"
@@ -187,7 +190,7 @@ func main() {
shieldsV1Router.PathPrefix("/{user}").Methods(http.MethodGet).HandlerFunc(shieldV1BadgeHandler.ApiGet)
// Static Routes
router.PathPrefix("/assets").Handler(http.FileServer(http.Dir("./static")))
router.PathPrefix("/assets").Handler(http.FileServer(pkger.Dir("./static")))
// Listen HTTP
listen(router)