summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorAditish51 <adtshukla519@gmail.com>2024-07-22 22:54:12 +0530
committerBlaster4385 <venkatesh@tablaster.dev>2024-07-25 17:15:39 +0530
commit26cf8aa1cbb894ce91e866da1227ea42a92fdfab (patch)
treec4fbb66c741bed69ebaf6102aea0a5359602ab4a /server
parent4016aa58005f968cca5b216e4188394b4d350095 (diff)
feat: added initial frontend
Diffstat (limited to 'server')
-rw-r--r--server/main.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/main.go b/server/main.go
index 683e0d0..9a1efbd 100644
--- a/server/main.go
+++ b/server/main.go
@@ -6,6 +6,7 @@ import (
"crypto/cipher"
"crypto/rand"
"database/sql"
+ "embed"
"encoding/hex"
"errors"
"fmt"
@@ -26,7 +27,16 @@ const (
var db *sql.DB
+//go:embed all:dist
+var dist embed.FS
+
func registerHandlers(e *echo.Echo) {
+ e.Use(middleware.StaticWithConfig(middleware.StaticConfig{
+ Root: "dist",
+ Index: "upload.html",
+ HTML5: true,
+ Filesystem: http.FS(dist),
+ }))
e.Use(middleware.Logger())
e.Use(middleware.Recover())
e.Use(middleware.CORS())