Closed rayterrill closed 3 years ago
Basic example:
package main import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/filesystem" "github.com/markbates/pkger" ) func main() { app := fiber.New() //serve react app app.Use("/", filesystem.New(filesystem.Config{ Root: pkger.Dir("../frontend/build"), })) app.Listen(":3000") }
Is there some other way to specify that the static files are up a directory?
This appears to work fine if the build directory is in the same directory as the go code itself (i.e. Root: pkger.Dir("/build") ).
Digging into this a little more - looks like maybe I'm misunderstanding how this works and this is by design per "There are no relative paths. All paths are absolute to the modules root."
Basic example:
Is there some other way to specify that the static files are up a directory?
This appears to work fine if the build directory is in the same directory as the go code itself (i.e. Root: pkger.Dir("/build") ).