Skip to content

Option to allow serving static files from root #748

Answered by RobinTail
Isaac-Leonard asked this question in Q&A
Discussion options

You must be logged in to vote

I see at least two ways of achieving that.

  1. Using an empty route
const routing: Routing = {
  "": new ServeStatic(path.join(__dirname, "assets"), {
    // express.static options
  }),
};
  1. Using a custom express app with a line
app.use("/", express.static({ /* ... */ }) );

I didn't try them, but probably it would work.
Did you try something like that, @Isaac-Leonard ?

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by RobinTail
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants