github tinyhttp/tinyhttp v1.2.0
v1.2: CLI and initial Deno support

latest releases: @tinyhttp/url@2.1.1, @tinyhttp/type-is@2.2.2, @tinyhttp/send@2.2.1...
3 years ago

v1.2 CLI and initial Deno support

Core

  • Add custom xPoweredBy setting (3ff7861)
  • Fix 404 with query parameters (80dd71c)
  • Align types to be identical to Express (fdc47db)
  • Get rid of deprecated url.parse in favor of a custom func (9a5573f)
  • Get rid of mutate function in app.handle (d533d2c)

New packages

  • the tinyhttp CLI has been created which allows you to easily quick start projects using the repository examples.

For example:

tinyhttp new prisma-graphql my-new-project --prettier --eslint
  • work on Deno port of tinyhttp has started. It's currently very basic and the more stable version of it is going to be in v2

Example from README:

import { App } from 'https://deno.land/x/tinyhttp@v0.0.3/app.ts'

const app = new App()

app.use('/', (req, next) => {
  console.log(`${req.method} ${req.url}`)

  next()
})

app.get('/:name/', (req) => {
  req.respond({ body: `Hello ${req.params.name}!` })
})

app.listen(3000, () => console.log(`Started on :3000`))

Wares

  • @tinyhttp/logger: no longer depend on core (01265c0)
  • @tinyhttp/cors: support a range of origins and regex (6502fcc)
  • @tinyhttp/cors: preflightContinue setting (c1cd15a)
  • @tinyhttp/cors: Fix 404 on OPTIONS in (263dd95)

Docs

  • Added a mention of req.range (de0ea55)
  • Show quick start in "Learn" page with the new tinyhttp CLI (0c788d6)
  • Add "Donate" secion in readme (7e81e5e)

Examples

Other

  • Add missing headers for res.sendFile (de0ea55)
  • Fix res.cookie not appending headers (bd5ca65)
  • Make value argument optional for res.set and res.header (b06d8d5)

Don't miss a new tinyhttp release

NewReleases is sending notifications on new releases.