refactor: register files service

This commit is contained in:
Derrick Hammer 2023-05-04 04:21:39 -04:00
parent ca3d3588a4
commit 37033bf45c
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 8 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import (
"git.lumeweb.com/LumeWeb/portal/config" "git.lumeweb.com/LumeWeb/portal/config"
"git.lumeweb.com/LumeWeb/portal/db" "git.lumeweb.com/LumeWeb/portal/db"
_ "git.lumeweb.com/LumeWeb/portal/docs" _ "git.lumeweb.com/LumeWeb/portal/docs"
"git.lumeweb.com/LumeWeb/portal/renterd"
"git.lumeweb.com/LumeWeb/portal/service" "git.lumeweb.com/LumeWeb/portal/service"
"git.lumeweb.com/LumeWeb/portal/validator" "git.lumeweb.com/LumeWeb/portal/validator"
"github.com/iris-contrib/swagger" "github.com/iris-contrib/swagger"
@ -15,6 +16,7 @@ import (
) )
// Embed a directory of static files for serving from the app's root path // Embed a directory of static files for serving from the app's root path
//
//go:embed app/* //go:embed app/*
var embedFrontend embed.FS var embedFrontend embed.FS
@ -43,6 +45,8 @@ func main() {
renterd.Ready() renterd.Ready()
service.InitFiles()
// Create a new Iris app instance // Create a new Iris app instance
app := iris.New() app := iris.New()
@ -66,6 +70,10 @@ func main() {
app.Handle(new(service.AuthService)) app.Handle(new(service.AuthService))
}) })
mvc.Configure(v1.Party("/files"), func(app *mvc.Application) {
app.Handle(new(service.FilesService))
})
swaggerConfig := swagger.Config{ swaggerConfig := swagger.Config{
// The url pointing to API definition. // The url pointing to API definition.
URL: "http://localhost:8080/swagger/doc.json", URL: "http://localhost:8080/swagger/doc.json",