Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Commit

Permalink
refactor assets into fqdn import, main package, move main package to …
Browse files Browse the repository at this point in the history
…cmd/pendulum
  • Loading branch information
titpetric committed Jan 29, 2018
1 parent 636ee5b commit 8cf36b3
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/build
/assets
/test
/contents
/pendulum
/codeship.aes
/.env
/.env
/assets_bindata.go
3 changes: 3 additions & 0 deletions assets.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package pendulum

//go:generate go-bindata -prefix front/src -o assets_bindata.go -pkg pendulum -nomemcopy front/src/dist/...
File renamed without changes.
File renamed without changes.
10 changes: 4 additions & 6 deletions main.go → cmd/pendulum/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ import (

"github.com/elazarl/go-bindata-assetfs"

"app/assets"
"github.com/titpetric/pendulum"
)

//go:generate go-bindata -prefix front/src -o assets/bindata.go -pkg assets -nomemcopy front/src/dist/...

// Serves index.html in case the requested file isn't found (or some other os.Stat error)
func serveIndex(serve http.Handler, fs assetfs.AssetFS) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -72,9 +70,9 @@ func main() {

assetPrefix := "dist"
assets := assetfs.AssetFS{
assets.Asset,
assets.AssetDir,
assets.AssetInfo,
pendulum.Asset,
pendulum.AssetDir,
pendulum.AssetInfo,
assetPrefix,
}
server := http.FileServer(&assets)
Expand Down
File renamed without changes.

0 comments on commit 8cf36b3

Please sign in to comment.