diff --git a/cmd/mixer-server/main.go b/cmd/mixer-server/main.go index 3d941da..e4d568b 100644 --- a/cmd/mixer-server/main.go +++ b/cmd/mixer-server/main.go @@ -2,6 +2,7 @@ package main import ( "flag" + "github.com/nicjohnson145/mixer-service/pkg/auth" "github.com/nicjohnson145/mixer-service/pkg/common" "github.com/nicjohnson145/mixer-service/pkg/db" @@ -9,6 +10,7 @@ import ( "github.com/nicjohnson145/mixer-service/pkg/health" "github.com/nicjohnson145/mixer-service/pkg/settings" "github.com/nicjohnson145/mixer-service/pkg/slow" + "github.com/nicjohnson145/mixer-service/pkg/static" "github.com/nicjohnson145/mixer-service/pkg/user" log "github.com/sirupsen/logrus" ) @@ -52,6 +54,10 @@ func main() { log.Fatal(err) } + if err := static.Init(app); err != nil { + log.Fatal(err) + } + port := common.DefaultedEnvVar("PORT", "30000") log.Info("Listening on port ", port) diff --git a/pkg/static/base.go b/pkg/static/base.go new file mode 100644 index 0000000..cf22b00 --- /dev/null +++ b/pkg/static/base.go @@ -0,0 +1,26 @@ +package static + +import ( + "embed" + _ "embed" + "net/http" + + "github.com/gofiber/fiber/v2" + "github.com/gofiber/fiber/v2/middleware/filesystem" +) + +//go:embed public +var publicWebUiContent embed.FS + +func Init(app *fiber.App) error { + addStaticRoutes(app) + return nil +} + +func addStaticRoutes(app *fiber.App) { + app.Use("/static/", filesystem.New(filesystem.Config{ + Root: http.FS(publicWebUiContent), + PathPrefix: "public/webui", + Browse: true, + })) +} diff --git a/pkg/static/public/webui/index.html b/pkg/static/public/webui/index.html new file mode 100644 index 0000000..f0a367e --- /dev/null +++ b/pkg/static/public/webui/index.html @@ -0,0 +1,15 @@ + + + + + + MixerDrinks Static Web Content Landing Page + + + + + +

Privacy Policy

+

Support

+ + \ No newline at end of file diff --git a/pkg/static/public/webui/privacy/index.html b/pkg/static/public/webui/privacy/index.html new file mode 100644 index 0000000..02b40df --- /dev/null +++ b/pkg/static/public/webui/privacy/index.html @@ -0,0 +1,15 @@ + + + + + + MixerDrinks Privacy Policy + + + + + +

All data you create is stored on the developers' personal servers. We won't sell it or do anything shitty with it. All drink + recipes you submit are shared with other users unless you disable "public profile" in your settings.

+ + \ No newline at end of file diff --git a/pkg/static/public/webui/support/index.html b/pkg/static/public/webui/support/index.html new file mode 100644 index 0000000..8777d87 --- /dev/null +++ b/pkg/static/public/webui/support/index.html @@ -0,0 +1,15 @@ + + + + + + MixerDrinks Support Page + + + + + +

This app is currently only available by invitations directly from the developers. If you have the app, you + must personally know one of the developers, and you can contact them yourself.

+ + \ No newline at end of file