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

feat:add sendFile func

Open markH5 opened this issue 1 year ago • 0 comments

  • https://github.com/honojs/node-server/issues/205
  • https://github.com/orgs/honojs/discussions/3755

exp:

// exp1
import { Hono } from 'hono'
import { sendFile } from './send-file'

let tf = true
const app = new Hono()
    .get('/my-path', (c, next) => {
        tf = !tf
        const filePath: string = tf
            ? 'C:/exp/bar.gif'
            : 'C:/exp/foo.jpg'
        return sendFile(c, filePath)
    })

This project uses bun as the package manager, but uses node to run tests, so is it normal that I cannot run jest in the Windows environment?

markH5 avatar Mar 18 '25 02:03 markH5