Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Trying to include static files using pkger.Dir("../frontend/build") results in "exit status 1: no Go files in /Users/me/app/frontend/build" #149

Closed
rayterrill opened this issue Jul 14, 2021 · 1 comment

Comments

@rayterrill
Copy link

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") ).

@rayterrill
Copy link
Author

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."

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant