aboutsummaryrefslogtreecommitdiff
path: root/cmd/server
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/server')
-rw-r--r--cmd/server/main.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go
index 385c54f..39987e5 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -4,13 +4,13 @@ import (
"context"
"encoding/hex"
"errors"
+ "net/http"
"os"
"os/signal"
- "github.com/fasthttp/router"
+ "github.com/gorilla/mux"
"github.com/sirupsen/logrus"
flag "github.com/spf13/pflag"
- "github.com/valyala/fasthttp"
"gorm.io/driver/mysql"
"gorm.io/driver/postgres"
"gorm.io/driver/sqlite"
@@ -71,8 +71,8 @@ func main() {
panic("failed to decode key database: " + err.Error())
}
- r := router.New()
- r.GET("/static/{filepath:*}", ext.FileServer(static.Static))
+ r := mux.NewRouter()
+ r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.FS(static.Static))))
// repository
var (
@@ -122,7 +122,7 @@ func main() {
// worker
var (
- serverWorker = worker.NewServerWorker(&fasthttp.Server{Handler: r.Handler, NoDefaultContentType: true})
+ serverWorker = worker.NewServerWorker(&http.Server{Handler: r, Addr: "0.0.0.0:8080"})
fileWorker = worker.NewWorkerFromChanProcessor[string](
fileScanner,
scheduler,