Skip to content

Add missing Express.js-style features#1

Open
nbeerbower wants to merge 1 commit into
mainfrom
claude/review-missing-features-01VU7AnXLtnv1GRwtBmHeGKo
Open

Add missing Express.js-style features#1
nbeerbower wants to merge 1 commit into
mainfrom
claude/review-missing-features-01VU7AnXLtnv1GRwtBmHeGKo

Conversation

@nbeerbower

Copy link
Copy Markdown
Contributor

New response methods:

  • res.sendStatus(code) - send status code with text body
  • res.append(name, value) - append to existing header
  • res.location(url) - set Location header without redirect
  • res.links(obj) - set Link header for pagination
  • res.etag(value) - set ETag header
  • res.lastModified(value) - set Last-Modified header
  • res.locals - request-scoped variables

New request properties:

  • req.hostname - parsed hostname from Host header
  • req.subdomains - array of subdomains
  • req.xhr - detect XMLHttpRequest
  • req.fresh(etag, lastModified) - cache validation
  • req.stale(etag, lastModified) - opposite of fresh

New app features:

  • app.locals - application-level variables
  • app.notFound(handler) - custom 404 handler
  • app.param(name, handler) - parameter preprocessing
  • body_limit option - configurable request body size limit

Also adds comprehensive tests for all new features.

New response methods:
- res.sendStatus(code) - send status code with text body
- res.append(name, value) - append to existing header
- res.location(url) - set Location header without redirect
- res.links(obj) - set Link header for pagination
- res.etag(value) - set ETag header
- res.lastModified(value) - set Last-Modified header
- res.locals - request-scoped variables

New request properties:
- req.hostname - parsed hostname from Host header
- req.subdomains - array of subdomains
- req.xhr - detect XMLHttpRequest
- req.fresh(etag, lastModified) - cache validation
- req.stale(etag, lastModified) - opposite of fresh

New app features:
- app.locals - application-level variables
- app.notFound(handler) - custom 404 handler
- app.param(name, handler) - parameter preprocessing
- body_limit option - configurable request body size limit

Also adds comprehensive tests for all new features.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants