Nine Pedestrians Mesmerized

    @tinyhttp/app
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.10 • Public • Published

    @tinyhttp/app

    The core of tinyhttp. Contains the App, Request and Response. Additionally, it provides special tinyhttp-specific types.

    Install

    pnpm i @tinyhttp/app

    Example

    import { App } from '@tinyhttp/app'
    import type { Request, Response, NextFunction } from '@tinyhttp/app'
    
    new App()
      .use((req: Request, res: Response, next: NextFunction) => {
        console.log('Did a request')
        next()
      })
      .get('/', (_, res) => res.send('<h1>Hello World</h1>'))
      .get('/page/:page', (req, res) => res.send(`You opened ${req.params.page}`))
      .listen(3000)

    Install

    npm i @tinyhttp/app

    DownloadsWeekly Downloads

    19,579

    Version

    2.0.10

    License

    MIT

    Unpacked Size

    26.4 kB

    Total Files

    10

    Last publish

    Collaborators

    • dropthebeatbro