feat: add files
This commit is contained in:
@@ -122,9 +122,12 @@ func Serve(cmd *cobra.Command, args []string) error {
|
|||||||
ctx.Set(fiber.HeaderContentType, mime)
|
ctx.Set(fiber.HeaderContentType, mime)
|
||||||
|
|
||||||
file, err := fabfile.Find(filepath.Join(svc.App.DistAdmin, f))
|
file, err := fabfile.Find(filepath.Join(svc.App.DistAdmin, f))
|
||||||
|
if err != nil {
|
||||||
|
file, err = fabfile.Find(filepath.Join(svc.App.DistAdmin, "index.html"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ctx.SendStatus(fiber.StatusNotFound)
|
return ctx.SendStatus(fiber.StatusNotFound)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ctx.SendFile(file)
|
return ctx.SendFile(file)
|
||||||
})
|
})
|
||||||
svc.Http.Engine.Get("*", func(ctx fiber.Ctx) error {
|
svc.Http.Engine.Get("*", func(ctx fiber.Ctx) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user