Use serveStatic to serve node_module files #3519
-
I have several npms that come with js/css that I would like to serve as static files. I can't figure out how to accomplish that with Hono's app.use(
'/inter-ui/*',
serveStatic({
root: './node_modules/',
})
); In the above example, I'm hoping to visit Any way to serve static files from within a node_module? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I got it figured out - my issue was Vite was taking over some of the routing. Running hono w/o vite along with something like |
Beta Was this translation helpful? Give feedback.
I got it figured out - my issue was Vite was taking over some of the routing. Running hono w/o vite along with something like
app.use('/inter-ui/inter.css', serveStatic({ root: './node_modules/' }));
works just fine,