+
@@ -282,6 +282,7 @@ app.use(mw1, [mw2, r1, r2], subApp)
+
Following are some examples of using the [express.static](/{{page.lang}}/guide/using-middleware.html#middleware.built-in)
middleware in an Express app.
diff --git a/_includes/api/en/4x/express.json.md b/_includes/api/en/4x/express.json.md
index f7cb4b7c1e..ffc460193d 100644
--- a/_includes/api/en/4x/express.json.md
+++ b/_includes/api/en/4x/express.json.md
@@ -26,6 +26,8 @@ For example, `req.body.foo.toString()` may fail in multiple ways, for example
function and instead a string or other user-input.
+
+
The following table describes the properties of the optional `options` object.
| Property | Description | Type | Default |
@@ -36,3 +38,5 @@ The following table describes the properties of the optional `options` object.
| `strict` | Enables or disables only accepting arrays and objects; when disabled will accept anything `JSON.parse` accepts. | Boolean | `true` |
| `type` | This is used to determine what media type the middleware will parse. This option can be a string, array of strings, or a function. If not a function, `type` option is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `json`), a mime type (like `application/json`), or a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a truthy value. | Mixed | `"application/json"` |
| `verify` | This option, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. | Function | `undefined` |
+
+
\ No newline at end of file
diff --git a/_includes/api/en/4x/express.raw.md b/_includes/api/en/4x/express.raw.md
index 0177f8dde0..cac172fb95 100644
--- a/_includes/api/en/4x/express.raw.md
+++ b/_includes/api/en/4x/express.raw.md
@@ -28,9 +28,13 @@ that `req.body` is a `Buffer` before calling buffer methods is recommended.
The following table describes the properties of the optional `options` object.
+
+
| Property | Description | Type | Default |
|-----------|-----------------------------------------------------------------------|-------------|-----------------|
| `inflate` | Enables or disables handling deflated (compressed) bodies; when disabled, deflated bodies are rejected. | Boolean | `true` |
| `limit` | Controls the maximum request body size. If this is a number, then the value specifies the number of bytes; if it is a string, the value is passed to the [bytes](https://www.npmjs.com/package/bytes) library for parsing. | Mixed | `"100kb"` |
| `type` | This is used to determine what media type the middleware will parse. This option can be a string, array of strings, or a function. If not a function, `type` option is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `bin`), a mime type (like `application/octet-stream`), or a mime type with a wildcard (like `*/*` or `application/*`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a truthy value. | Mixed | `"application/octet-stream"` |
| `verify` | This option, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. | Function | `undefined` |
+
+
\ No newline at end of file
diff --git a/_includes/api/en/4x/express.static.md b/_includes/api/en/4x/express.static.md
index 065ecb2762..b92c2d7b36 100644
--- a/_includes/api/en/4x/express.static.md
+++ b/_includes/api/en/4x/express.static.md
@@ -16,6 +16,8 @@ to move on to the next middleware, allowing for stacking and fall-backs.
The following table describes the properties of the `options` object.
See also the [example below](#example.of.express.static).
+
+
| Property | Description | Type | Default |
|---------------|-----------------------------------------------------------------------|-------------|-----------------|
| `dotfiles` | Determines how dotfiles (files or directories that begin with a dot ".") are treated.
See [dotfiles](#dotfiles) below. | String | `undefined` |
@@ -29,6 +31,8 @@ See also the [example below](#example.of.express.static).
| `redirect` | Redirect to trailing "/" when the pathname is a directory. | Boolean | `true` |
| `setHeaders` | Function for setting HTTP headers to serve with the file.
See [setHeaders](#setHeaders) below. | Function | |
+
+
For more information, see [Serving static files in Express](/starter/static-files.html).
and [Using middleware - Built-in middleware](/{{page.lang}}/guide/using-middleware.html#middleware.built-in).
diff --git a/_includes/api/en/4x/express.text.md b/_includes/api/en/4x/express.text.md
index 90364c6d76..4d762427e5 100644
--- a/_includes/api/en/4x/express.text.md
+++ b/_includes/api/en/4x/express.text.md
@@ -28,6 +28,8 @@ that `req.body` is a string before calling string methods is recommended.
The following table describes the properties of the optional `options` object.
+
+
| Property | Description | Type | Default |
|------------------|-----------------------------------------------------------------------|-------------|-----------------|
| `defaultCharset` | Specify the default character set for the text content if the charset is not specified in the `Content-Type` header of the request. | String | `"utf-8"` |
@@ -35,3 +37,5 @@ The following table describes the properties of the optional `options` object.
| `limit` | Controls the maximum request body size. If this is a number, then the value specifies the number of bytes; if it is a string, the value is passed to the [bytes](https://www.npmjs.com/package/bytes) library for parsing. | Mixed | `"100kb"` |
| `type` | This is used to determine what media type the middleware will parse. This option can be a string, array of strings, or a function. If not a function, `type` option is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `txt`), a mime type (like `text/plain`), or a mime type with a wildcard (like `*/*` or `text/*`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a truthy value. | Mixed | `"text/plain"` |
| `verify` | This option, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. | Function | `undefined` |
+
+
\ No newline at end of file
diff --git a/_includes/api/en/4x/express.urlencoded.md b/_includes/api/en/4x/express.urlencoded.md
index f20ae40e30..7e1c7e4714 100644
--- a/_includes/api/en/4x/express.urlencoded.md
+++ b/_includes/api/en/4x/express.urlencoded.md
@@ -29,6 +29,8 @@ function and instead a string or other user-input.
The following table describes the properties of the optional `options` object.
+
+
| Property | Description | Type | Default |
|------------------|-----------------------------------------------------------------------|-------------|-----------------|
| `extended` | This option allows to choose between parsing the URL-encoded data with the `querystring` library (when `false`) or the `qs` library (when `true`). The "extended" syntax allows for rich objects and arrays to be encoded into the URL-encoded format, allowing for a JSON-like experience with URL-encoded. For more information, please [see the qs library](https://www.npmjs.org/package/qs#readme). | Boolean | `true` |
@@ -37,3 +39,5 @@ The following table describes the properties of the optional `options` object.
| `parameterLimit` | This option controls the maximum number of parameters that are allowed in the URL-encoded data. If a request contains more parameters than this value, an error will be raised. | Number | `1000` |
| `type` | This is used to determine what media type the middleware will parse. This option can be a string, array of strings, or a function. If not a function, `type` option is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `urlencoded`), a mime type (like `application/x-www-form-urlencoded`), or a mime type with a wildcard (like `*/x-www-form-urlencoded`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a truthy value. | Mixed | `"application/x-www-form-urlencoded"` |
| `verify` | This option, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. | Function | `undefined` |
+
+
\ No newline at end of file
diff --git a/_includes/api/en/4x/req-range.md b/_includes/api/en/4x/req-range.md
index e6411c662d..dbf2afeb5e 100644
--- a/_includes/api/en/4x/req-range.md
+++ b/_includes/api/en/4x/req-range.md
@@ -6,9 +6,13 @@ The `size` parameter is the maximum size of the resource.
The `options` parameter is an object that can have the following properties.
+
+
| Property | Type | Description |
|-------------|-------------------------------------------------------------------------|
-| `combine` | Boolean | Specify if overlapping & adjacent ranges should be combined, defaults to `false`. When `true`, ranges will be combined and returned as if they were specified that way in the header.
+| `combine` | Boolean | Specify if overlapping & adjacent ranges should be combined, defaults to `false`. When `true`, ranges will be combined and returned as if they were specified that way in the header.|
+
+
An array of ranges will be returned or negative numbers indicating an error parsing.
diff --git a/_includes/api/en/4x/res-cookie.md b/_includes/api/en/4x/res-cookie.md
index 2cd8d32f10..814779340c 100644
--- a/_includes/api/en/4x/res-cookie.md
+++ b/_includes/api/en/4x/res-cookie.md
@@ -4,19 +4,23 @@ Sets cookie `name` to `value`. The `value` parameter may be a string or object
The `options` parameter is an object that can have the following properties.
+
+
| Property | Type | Description |
|---------------|-------------------------------------------------------------------------|
-| `domain` | String | Domain name for the cookie. Defaults to the domain name of the app.
-| `encode` | Function | A synchronous function used for cookie value encoding. Defaults to `encodeURIComponent`.
-| `expires` | Date | Expiry date of the cookie in GMT. If not specified or set to 0, creates a session cookie.
-| `httpOnly` | Boolean | Flags the cookie to be accessible only by the web server.
-| `maxAge` | Number | Convenient option for setting the expiry time relative to the current time in milliseconds.
-| `path` | String | Path for the cookie. Defaults to "/".
-| `partitioned` | Boolean | Indicates that the cookie should be stored using partitioned storage. See [Cookies Having Independent Partitioned State (CHIPS)](https://developer.mozilla.org/en-US/docs/Web/Privacy/Partitioned_cookies) for more details.
-| `priority` | String | Value of the "Priority" **Set-Cookie** attribute.
-| `secure` | Boolean | Marks the cookie to be used with HTTPS only.
-| `signed` | Boolean | Indicates if the cookie should be signed.
-| `sameSite` | Boolean or String | Value of the "SameSite" **Set-Cookie** attribute. More information at [https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1).
+| `domain` | String | Domain name for the cookie. Defaults to the domain name of the app.|
+| `encode` | Function | A synchronous function used for cookie value encoding. Defaults to `encodeURIComponent`.|
+| `expires` | Date | Expiry date of the cookie in GMT. If not specified or set to 0, creates a session cookie.|
+| `httpOnly` | Boolean | Flags the cookie to be accessible only by the web server.|
+| `maxAge` | Number | Convenient option for setting the expiry time relative to the current time in milliseconds.|
+| `path` | String | Path for the cookie. Defaults to "/".|
+| `partitioned` | Boolean | Indicates that the cookie should be stored using partitioned storage. See [Cookies Having Independent Partitioned State (CHIPS)](https://developer.mozilla.org/en-US/docs/Web/Privacy/Partitioned_cookies) for more details.|
+| `priority` | String | Value of the "Priority" **Set-Cookie** attribute.|
+| `secure` | Boolean | Marks the cookie to be used with HTTPS only.|
+| `signed` | Boolean | Indicates if the cookie should be signed.|
+| `sameSite` | Boolean or String | Value of the "SameSite" **Set-Cookie** attribute. More information at [https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1).|
+
+
All `res.cookie()` does is set the HTTP `Set-Cookie` header with the options provided.
diff --git a/_includes/api/en/4x/routing-args.html b/_includes/api/en/4x/routing-args.html
index 4a3bc6fefe..6dd9fe8712 100644
--- a/_includes/api/en/4x/routing-args.html
+++ b/_includes/api/en/4x/routing-args.html
@@ -1,49 +1,55 @@
-
Arguments
+
Arguments
-
-
-| Argument |
- Description |
- Default |
-
-
-
-path |
-
-The path for which the middleware function is invoked; can be any of:
-
-- A string representing a path.
-- A path pattern.
-- A regular expression pattern to match paths.
-- An array of combinations of any of the above.
-
-
-For examples, see Path examples.
- |
-'/' (root path) |
-
-
-
- callback |
-
-Callback functions; can be:
-
-- A middleware function.
-- A series of middleware functions (separated by commas).
-- An array of middleware functions.
-- A combination of all of the above.
-
-
-You can provide multiple callback functions that behave just like middleware, except
-that these callbacks can invoke next('route') to bypass
-the remaining route callback(s). You can use this mechanism to impose pre-conditions
-on a route, then pass control to subsequent routes if there is no reason to proceed with the current route.
-
-Since router and app implement the middleware interface,
-you can use them as you would any other middleware function.
-
-For examples, see Middleware callback function examples.
-
- |
- None |
-
+
\ No newline at end of file
diff --git a/_includes/api/en/5x/req-range.md b/_includes/api/en/5x/req-range.md
index 8ebce46382..1444f8f816 100644
--- a/_includes/api/en/5x/req-range.md
+++ b/_includes/api/en/5x/req-range.md
@@ -6,9 +6,13 @@ The `size` parameter is the maximum size of the resource.
The `options` parameter is an object that can have the following properties.
+
+
| Property | Type | Description |
|-------------|-------------------------------------------------------------------------|
-| `combine` | Boolean | Specify if overlapping & adjacent ranges should be combined, defaults to `false`. When `true`, ranges will be combined and returned as if they were specified that way in the header.
+| `combine` | Boolean | Specify if overlapping & adjacent ranges should be combined, defaults to `false`. When `true`, ranges will be combined and returned as if they were specified that way in the header.|
+
+
An array of ranges will be returned or negative numbers indicating an error parsing.
From 7eb73353eac193ca424f3dbfb357d34e06978fed Mon Sep 17 00:00:00 2001
From: shubham oulkar <91728992+ShubhamOulkar@users.noreply.github.com>
Date: Thu, 12 Jun 2025 09:04:10 +0000
Subject: [PATCH 3/4] remove content overflow for mobile devices
---
css/style.css | 93 ++++++++++++++++++++++++++++++++---------------
css/variables.css | 9 -----
2 files changed, 64 insertions(+), 38 deletions(-)
diff --git a/css/style.css b/css/style.css
index 60fd04fcac..c9cb369a27 100644
--- a/css/style.css
+++ b/css/style.css
@@ -9,6 +9,23 @@ body {
margin: 0;
padding: 0;
color: var(--fg);
+ display: grid;
+ grid-template-areas:
+ 'header'
+ 'content'
+ 'footer'
+}
+
+header {
+ grid-area: header;
+}
+
+.content {
+ grid-area: content;
+}
+
+footer {
+ grid-area: footer;
}
body.no-scroll{
@@ -75,10 +92,6 @@ main.home {
display: flex;
}
-.en-doc #home-content {
- margin-top: 150px;
-}
-
.non-en-doc:has(#i18n-notice-box.hidden) #home-content {
margin-top: 150px;
}
@@ -157,13 +170,13 @@ main.home {
}
.content {
- margin: 153px 0 7%;
display: flex;
flex-direction: row-reverse;
+ padding-inline-start: 1rem;
+ margin-block-start: 3.5rem;
}
.content main {
- padding-inline: 16px;
max-width: 900px;
margin-inline: auto;
}
@@ -324,17 +337,12 @@ a {
}
header {
- position: fixed;
- top: 0;
- left: 0;
background: var(--card-bg);
- width: 100%;
height: 57px;
display: flex;
align-items: center;
justify-content: space-between;
- padding-inline: 25px;
- z-index: 200;
+ padding-inline: 1.5rem;
border-bottom: 1px solid var(--hover-fg);
}
@@ -559,36 +567,39 @@ html[xmlns] .clearfix {
list-style: none;
}
-/* doc specific */
+/* tables specific */
-.doctable, table {
+table {
margin: 1em 0;
border: 1px solid var(--border);
border-collapse: collapse;
width: 100%;
+ @media screen and (max-width:600px) {
+ font-size: smaller;
+ }
}
-.doctable td, .doctable th, table td, table th {
+table td, table th {
padding: 7px;
line-height: 120%;
vertical-align: top;
border: 1px solid var(--border);
}
-.doctable tr th, table tr th {
+table tr th {
background: var(--card-bg);
font-size: 110%;
}
-.doctable td p:first-child {
+table td p:first-child {
margin-top: 0;
}
-.doctable td p, li p {
+table td p, li p {
width: 100% !important;
}
-.doctable ul {
+table ul {
margin: 20px 0
}
@@ -701,12 +712,15 @@ pre, code {
white-space: pre-wrap !important;
}
+/* footer */
+
footer {
font-size: 12px;
- margin: 60px 5% 30px;
display: flex;
gap: 24px;
flex-direction: column;
+ padding-block: 2rem;
+ padding-inline: 3rem;
}
#footer-content {
@@ -731,7 +745,7 @@ footer {
max-width: 125px;
}
-#footer-policy{
+#footer-policy {
display: flex;
flex-wrap: wrap;
column-gap: 20px;
@@ -740,15 +754,21 @@ footer {
font-size: 15px;
}
-#footer-links{
+#footer-links {
display: flex;
gap: 20px;
+ flex-wrap: wrap;
}
.footer-social {
display: flex;
gap: 20px;
font-size: 20px;
+ @media screen and (max-width: 340px) {
+ display: grid;
+ grid-template-columns: 1fr 1fr 1fr;
+ gap: 2.5rem;
+ }
}
/* theme and lang btn */
@@ -1148,6 +1168,19 @@ h2 a {
}
}
+/* routing methods columns */
+.methods-columns {
+ display: flex;
+ gap: 2rem;
+ justify-content: space-between;
+ flex-wrap: wrap;
+
+ @media screen and (max-width: 460px) {
+ flex-direction: column;
+ gap: 0.3rem;
+ }
+}
+
/* responsive */
@media all and (max-width: 1440px) {
@@ -1301,9 +1334,16 @@ h2 a {
/* TOC responsive */
@media all and (max-width: 800px) {
.content {
- margin-inline: 0.5rem;
- margin-block-start: 100px;
flex-direction: column;
+ padding-inline-start : 0;
+ margin-block-start: 1rem;
+ }
+
+ .content main {
+ padding-inline: 1rem;
+ width: 100vw;
+ margin-top: 0;
+ margin-inline: 0;
}
#api-doc,
@@ -1618,11 +1658,6 @@ blockquote {
}
@media all and (max-width: 1110px) {
- header {
- column-gap: 12px;
- padding-inline: 32px;
- }
-
.desktop-lang-switcher {
display: none;
}
diff --git a/css/variables.css b/css/variables.css
index 48d581b775..5680810934 100644
--- a/css/variables.css
+++ b/css/variables.css
@@ -50,12 +50,3 @@
--supported-fg:#299009;
--eol-fg: #ff1a1a;
}
-
-
-/* new css */
-.methods-columns {
- display: flex;
- gap: 2rem;
- justify-content: space-between;
- flex-wrap: wrap;
-}
\ No newline at end of file
From 31e040ad0e76b841175a0a28fa34bde169374557 Mon Sep 17 00:00:00 2001
From: shubham oulkar <91728992+ShubhamOulkar@users.noreply.github.com>
Date: Thu, 12 Jun 2025 09:14:32 +0000
Subject: [PATCH 4/4] remove inline padding from main conatent
---
css/style.css | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/css/style.css b/css/style.css
index c9cb369a27..292ee24c9d 100644
--- a/css/style.css
+++ b/css/style.css
@@ -1349,10 +1349,13 @@ h2 a {
#api-doc,
#blog-doc,
#page-doc {
- padding-inline: 1rem;
width: 100%;
}
+ #api-doc section {
+ padding-left: 0;
+ }
+
.toc-container {
display: flex;
flex-direction: column;