node-server icon indicating copy to clipboard operation
node-server copied to clipboard

feat(serve-static): support absolute path for `root`

Open yusukebe opened this issue 1 year ago • 2 comments

This PR enables the serve static to support an absolute path for the root option.

import { serveStatic } from '@hono/node-server'
import { serve } from '@hono/node-server/serve-static'
import { Hono } from 'hono'

const app = new Hono()
app.use('/static/*', serveStatic({ root: '/home/yusuke/app' }))

serve(app)

Closes #187 Related to https://github.com/honojs/hono/pull/3420

yusukebe avatar Sep 30 '24 08:09 yusukebe

Hey @usualoma !

Can you review this?

yusukebe avatar Sep 30 '24 08:09 yusukebe

@usualoma

I have some thoughts related to https://github.com/honojs/node-server/issues/203 and we don't have to hurry to merge this because this PR may be not needed. So, please don't review this now. Thank you!

yusukebe avatar Oct 01 '24 08:10 yusukebe