Releases: tinyhttp/tinyhttp
@tinyhttp/[email protected]
What's Changed
- Support for url forwarding (#440) by @aweigor in #441
- New property -
req.port
by @Lordfirespeed in #439 - Dedupe
mime
dependency
Misc
- remove vite from build step
- bump dev deps
- enable strict mode in TypeScript settings
New Contributors
Full Changelog: https://github.com/tinyhttp/tinyhttp/compare/@tinyhttp/[email protected]...@tinyhttp/[email protected]
@tinyhttp/[email protected]
What's Changed
- Update README.md by @talentlessguy in #432
- tell c8 to ignore
types.ts
for coverage by @Lordfirespeed in #435 - Fix/subapps blocking middleware by @Lordfirespeed in #434
Full Changelog: https://github.com/tinyhttp/tinyhttp/compare/@tinyhttp/[email protected]...@tinyhttp/[email protected]
@tinyhttp/[email protected]
What's Changed
- Feat/trust proxy by @Lordfirespeed in #430
New Contributors
- @Lordfirespeed made their first contribution in #430
Full Changelog: https://github.com/tinyhttp/tinyhttp/compare/@tinyhttp/[email protected]...@tinyhttp/[email protected]
@tinyhttp/[email protected]
What's Changed
- Feat/trust proxy by @Lordfirespeed in #430
New Contributors
- @Lordfirespeed made their first contribution in #430
Full Changelog: https://github.com/tinyhttp/tinyhttp/compare/@tinyhttp/[email protected]...@tinyhttp/[email protected]
@tinyhttp/[email protected]
Fixed res.json
hanging if number or boolean was passed (initial work in #426).
thanks to @JTBrinkmann for contributing the fix.
@tinyhttp/[email protected]
What's Changed
- test: increased coverage for content-disposition, jsonp and type-is by @aarontravass in #411
- fix: subapps mount regardless if path has leading slash or not by @aarontravass in #419
- fix: correctly update req.url on routes and mws by @adhusson in #420
New Contributors
Full Changelog: https://github.com/tinyhttp/tinyhttp/compare/@tinyhttp/[email protected]...@tinyhttp/[email protected]
v2.2: New (old) view engine
v.2.2
Features
new View engine
by @talentlessguy in #401
View engine was ported from express for cases like multiple view engines and custom View
processing. See docs for more info.
App
doesn't require a first argument as engine options in a generic anymore. Instead pass engine options to app.engine
and res.render
.
Example:
import { App } from '@tinyhttp/app'
import { renderFile, type EtaConfig } from 'eta'
import type { PartialConfig } from 'eta/dist/types/config'
const app = new App()
app.engine('eta', eta.renderFile)
app.use((_, res) => void res.render<PartialConfig>('index.eta', { name: 'Eta' }))
app.listen(3000, () => console.log(`Listening on http://localhost:3000`))
new type: AppConstructor
A constructor type for @tinyhttp/app
has been moved into a type for more convenience:
import type { AppConstructor } from '@tinyhttp/app'
new App method: app.disabled
Returns if a setting is disabled:
app.disabled('networkExtensions') // true
Bug Fixes
- properly set
req.xhr
from a header by @aarontravass in #408 req.route
us assigned the correct middleware if multiple are present by @aarontravass in #409
Improvements
- Cut down total deps of
@tinyhttp/app
from 25 to 23. - Install size of
@tinyhttp/app
decreased from 692KB to 540KB (22% smaller) by switching fromes-mime-types
tomime@beta
app.set
,app.enable
andapp.disable
now have stricter typesapp.engine
supports extensions with and without a dotapp.render
,res.render
andapp.engine
support passing template engine options as a generic- a few
es-
modules owned by @talentlessguy are moved to the tinyhttp organization to avoid lock-in and make it easier to maintain
New examples
Full Changelog: https://github.com/tinyhttp/tinyhttp/compare/@tinyhttp/[email protected]...@tinyhttp/[email protected]
@tinyhttp/[email protected]
@tinyhttp/[email protected]
@tinyhttp/[email protected]
What's Changed
- Correct type declaration by @bullno1 in #378
- feat: Issue #377 added the ability to accept multiple paths by @aarontravass in #379
New Contributors
- @bullno1 made their first contribution in #378
- @aarontravass made their first contribution in #379
Full Changelog: https://github.com/tinyhttp/tinyhttp/compare/@tinyhttp/[email protected]...@tinyhttp/[email protected]