Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing rootPath per call #22

Closed
tzookb opened this issue Nov 16, 2020 · 2 comments
Closed

Changing rootPath per call #22

tzookb opened this issue Nov 16, 2020 · 2 comments

Comments

@tzookb
Copy link

tzookb commented Nov 16, 2020

Hey 👋

I’m serving my sites from two diff domains:

  • example.com
  • other.com/site/folder/

How do I make sure my static files will be served properly?

Because whatever version i tried it only supported one of the two each time

Thanks!

@pkoretic
Copy link
Owner

Hi @tzookb
I believe you can just create two different middlewares ?

app.use(serve({rootDir: 'web'}))
app.use(serve({rootDir: site/folder', rootPath: '/web'}))

you might also want to use last: false with the first route

@tzookb
Copy link
Author

tzookb commented Nov 20, 2020

Nice
I’ll surely try it out.
My current hack I did is adding a middleware that remove the extra path from the url

@tzookb tzookb closed this as completed Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants