elysiajs / elysia-static

Plugin for Elysia for serving static folder
MIT License
12 stars 15 forks source link

Invalid mime type for serving css? #33

Open jvanveen opened 1 month ago

jvanveen commented 1 month ago

It seems that a css file is returned with the incorrect mime type. Any idea what may be wrong? image

jvanveen commented 1 month ago

As a workaround, I used:

    app.get('/public/*', ({set, params}) => {
        const file = Bun.file(`${import.meta.dir}/../public/${params['*']}`)
        set.headers['Content-Type'] = file.type
        return file.text()
    })

As being mentioned at https://github.com/elysiajs/elysia/issues/524