Option to allow serving static files from root #748
-
Currently static files need to be served from a specific subpath. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I see at least two ways of achieving that.
const routing: Routing = {
"": new ServeStatic(path.join(__dirname, "assets"), {
// express.static options
}),
};
app.use("/", express.static({ /* ... */ }) ); I didn't try them, but probably it would work. |
Beta Was this translation helpful? Give feedback.
-
However, I'd say, that if your express app serves files from the root path, then it is only capable of serving files. I mean... There is no need for routing, IO validations and all that. No need for this library in that case. |
Beta Was this translation helpful? Give feedback.
I see at least two ways of achieving that.
I didn't try them, but probably it would work.
Did you try something like that, @Isaac-Leonard ?