Skip to content

Releases: tinyhttp/tinyhttp

v1.1.0. Markdown server upgrade & minor fixes

21 Dec 16:59

Choose a tag to compare

Core

  • Fixes bugs with req.url, req.path and req.originaUrl (#203)
  • Fixes res.redirect incorrect URI encoding (#205)
  • Fixes res.set (and extensions using it) not adding charset
  • Fixes res.render not inheriting template engine settings

Middleware

  • @tinyhttp/markdown now sends a stream instead of plain text using streamdown
  • @tinyhttp/markdown doesn't have recursive option anymore. Instead of file listing, the current directory is switched in case the path contains a directory. Therefore, the ware no longer depends on readdirp
  • @tinyhttp/markdown now has a caching setting to configure Cache-Control header
  • @tinyhttp/session now uses express-session as direct dependency instead of dev (#201)

Docs

  • Fix typo with router methods in the docs (#204)

v1.0. The time has come.

24 Nov 20:10

Choose a tag to compare

Finally, after months of hard work, different implementation decisions, collaborations with contributors I'm thrilled to announce the first stable release of tinyhttp!

Express API implementation

100% ready. The only method that isn't implemented is app.param, which was deprecated in Express 4.11.

Core

Catching errors in async handlers

errors thrown in async handlers are now catched and passed to next, e.g. if an error is throwed in a handler it won't crash and will keep working.

Example:

import { App } from '@tinyhttp/app'

const app = new App()

app.use(async (_req, _res) => {
  throw `error`
})

app.listen(3000)

The app will return the error and send 500 status:

$ curl localhost:3000
error

Custom middleware extensions

WIth the new applyExtensions parameter you can define your own req / res extensions, or disable all tinyhttp's extensions to achieve the best performance.

import { App } from '@tinyhttp/app'
import { send } from '@tinyhttp/send'

const app = new App({
  applyExtensions: (req, res, next) => {
    // now tinyhttp only has a `res.send` extension
    res.send = send(req, res)
  }
})

Other changes

  • Test coverage is increased to 92%
  • The majority of tinyhttp's modules have more flexible types now which don't require the full implementation of IncomingMessage and ServerResponse objects but only the properties which are used inside the module. This will let developers use these packages inside their own projects and not only in Node.js runtime.
  • Docs are updated with the current status of the project.

tinyhttp 0.5

16 Oct 16:13

Choose a tag to compare

During hacktoberfest, lots of folks helped the project by submitting examples, writing tests and creating new middlewares. Thanks to everyone who contributed to the project!

Release details

Express API implementation progress

~96% of API is ready. Only a few methods left.

  • res.append
  • req.path

New middleware

New examples

  • Prisma REST API
  • Prisma GraphQL
  • PostgreSQL
  • Sapper (Svelte SSR)
  • React SSR
  • rate limiting
  • auth (session)
  • search engine

Other minor changes

  • Coverage increase from 60% to 71%

  • @tinyhttp/markdown's recursive prop works properly now

0.4.X: Closer and closer to Express

22 Sep 20:20

Choose a tag to compare

In 0.4.X a lot of new req / res extensions are added, also some new app settings.

Request / Response extensions

Request

Properties

  • req.subdomains
  • req.app

Methods

  • req.acceptsCharsets
  • req.acceptsEncodings
  • req.acceptsLanguages
  • req.is

Response

Properties

  • res.locals
  • res.app

Methods

  • res.type
  • res.format
  • res.redirect 🎉

App

App now has 2 new settings:

  • subdomainOffset - configuration of req.subdomains domain offset
  • bindAppToReqRes - access req.app and res.app

Packages

Created new package - @tinyhttp/type-is

0.3.X

18 Sep 19:00

Choose a tag to compare

This is the first proper github minor release with lots of fixes and changes, all were made during a few months of hard work. Also, during this period, tinyhttp gained quite a good starting audience, people already start using it and I feel excited for what cool things can be built with tinyhttp!

Anyways, here's the release notes (I will probably automate it later):

  • add template engine support
  • add sendFile function (most recent addition) and a lot of other Express methods
  • finish writing the docs
  • add "common tasks" and "advanced topics" sections to docs
  • split @tinyhttp/app by 4 separate framework-agnostic packages
  • setup husky and commitlint
  • add 25 examples
  • add 10 middlewares, including @tinyhttp/session, @tinyhttp/ip-filter and more