--- a/frontend/frontend.go Thu Jul 16 19:03:10 2020 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-//go:generate esc -o embedded.go -pkg frontend -include .+ -prefix dist dist/
- "github.com/gin-gonic/contrib/static"
- "github.com/gin-gonic/gin"
-type embeddedFS struct {
-func (e *embeddedFS) Exists(prefix, path string) bool {
- full := filepath.Join(prefix, path)
- if _, found := _escData[full]; !found {
-func Routes(router *gin.Engine) {
- router.Use(static.Serve("/", &embeddedFS{FileSystem: Dir(false, "/")}))
--- a/frontend/vue.config.js Thu Jul 16 19:03:10 2020 -0500
+++ b/frontend/vue.config.js Fri Nov 13 23:04:28 2020 -0600
@@ -1,4 +1,5 @@
--- a/server/cmd.go Thu Jul 16 19:03:10 2020 -0500
+++ b/server/cmd.go Fri Nov 13 23:04:28 2020 -0600
@@ -13,8 +13,9 @@
- ListenAddr string `kong:"flag,name='listen-addr',help='The address to listen on.',default=':1234'"`
- StoragePath string `kong:"flag,name='storage-path',help='The path to store files in.',default='data'"`
+ ListenAddr string `kong:"flag,name='listen-addr',help='The address to listen on.',default=':1234'"` + StoragePath string `kong:"flag,name='storage-path',help='The path to store files in.',default='data'"` + FrontendPath string `kong:"flag,name='frontend-path',help='The path to the frontend files.',default='frontend'"` func (c *Cmd) Run() error {
@@ -38,7 +39,7 @@
- if err := server.Listen(); err != nil {
+ if err := server.Listen(c.FrontendPath); err != nil { --- a/server/server.go Thu Jul 16 19:03:10 2020 -0500
+++ b/server/server.go Fri Nov 13 23:04:28 2020 -0600
@@ -7,7 +7,6 @@
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
- "keep.imfreedom.org/grim/devweb/frontend"
"keep.imfreedom.org/grim/devweb/storage"
"keep.imfreedom.org/grim/devweb/v1"
@@ -31,13 +30,16 @@
-func (s *Server) Listen() error {
+func (s *Server) Listen(frontendPath string) error { gin.SetMode(gin.ReleaseMode)
+ router.GET("/", redirectToApp) // add the frontend routes
- frontend.Routes(router)
+ router.Static("/app/", frontendPath) // add our storage routes
s.storage.Routes(&router.RouterGroup)