зеркало из https://github.com/github/docs.git
b9ee89fc46
* Redirect homepage to user's language * Redirect URLs with no language code * Add leading forward slash * Revert "Redirect URLs with no language code" This reverts commit f817ac1136ea0c7e11c4d61327a4445b56a2f5d6. * Simplify per @zeke * Add homepage language redirect tests * Update middleware/redirects/handle-redirects.js Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com> * braces are good Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com> |
||
---|---|---|
.. | ||
contextualizers | ||
redirects | ||
README.md | ||
abort.js | ||
archived-enterprise-versions-assets.js | ||
archived-enterprise-versions.js | ||
block-robots.js | ||
catch-bad-accept-language.js | ||
categories-for-support.js | ||
connect-datadog.js | ||
context.js | ||
cookie-parser.js | ||
cors.js | ||
csp.js | ||
csrf.js | ||
detect-language.js | ||
disable-caching-on-safari.js | ||
events.js | ||
featured-links.js | ||
find-page.js | ||
halt-on-dropped-connection.js | ||
handle-csrf-errors.js | ||
handle-errors.js | ||
handle-invalid-paths.js | ||
handle-next-data-path.js | ||
index.js | ||
is-next-request.js | ||
learning-track.js | ||
loaderio-verification.js | ||
next.js | ||
package.json | ||
rate-limit.js | ||
record-redirect.js | ||
render-page.js | ||
req-utils.js | ||
robots.js | ||
search.js | ||
set-fastly-cache-headers.js | ||
set-fastly-surrogate-key.js | ||
timeout.js | ||
trigger-error.js |
README.md
Middleware
Each file in this directory exports an Express Middleware function.
For more info, see https://expressjs.com/en/guide/using-middleware.html
Subdirectories
There are subdirectories for different types of middleware:
- contextualizers modify the
req.context
object that is used to render pages. - redirects handle... redirects!