packr icon indicating copy to clipboard operation
packr copied to clipboard

Stuck on an issue

Open Daavidaviid opened this issue 6 years ago • 1 comments

Hi, How does one serve a front-end web app with packr2 ?

Here's my issue, I'm trying to serve a static website from a folder ../webapp/public, except it doesn't work as I was expecting it to.

Basically here's how I'd like to serve file :

// router is a chi router
router.Handle("/webapp/", http.StripPrefix("/webapp/", http.FileServer(WebAppBox)))

But everytime I get this : 404 page not found

How does one should proceed to get it working as expected ?

And also If my webapp is using a router on the front end, sometimes I might receive request at the following address : /webapp/someSpecificPage/blabla, how could one, using packr2, make sure it doesn't fail ? Because naturally it will look for a file located at webapp/someSpecificPage/blabla/ except it doesn't exist..

Thanks in advance for helping me.

Daavidaviid avatar Mar 04 '19 11:03 Daavidaviid

@Daavidaviid This seems similar to some other issues addressed by #201 . Would you mind pulling down that branch and seeing if it fixes your issue? Alternatively, could you post a minimal reproducing example of the issue that you’re running into so that we can test against that PR?

timraymond avatar Jun 08 '19 03:06 timraymond