diff options
author | 2024-01-17 13:11:46 +0000 | |
---|---|---|
committer | 2024-01-17 13:11:46 +0000 | |
commit | 73380661c2fece72694e10c49571a4a8e38c2b94 (patch) | |
tree | 088eced2a3add70cbf4d109ba8974868d8c83ab3 /packages/integrations/node/src/serve-static.ts | |
parent | f61248895b8b7007c1fd5dccbd550f2d123f2da2 (diff) | |
download | astro-73380661c2fece72694e10c49571a4a8e38c2b94.tar.gz astro-73380661c2fece72694e10c49571a4a8e38c2b94.tar.zst astro-73380661c2fece72694e10c49571a4a8e38c2b94.zip |
[ci] format
Diffstat (limited to 'packages/integrations/node/src/serve-static.ts')
-rw-r--r-- | packages/integrations/node/src/serve-static.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/integrations/node/src/serve-static.ts b/packages/integrations/node/src/serve-static.ts index ee3bdaf79..77de9b358 100644 --- a/packages/integrations/node/src/serve-static.ts +++ b/packages/integrations/node/src/serve-static.ts @@ -1,9 +1,9 @@ -import path from "node:path"; -import url from "node:url"; -import send from "send"; -import type { IncomingMessage, ServerResponse } from "node:http"; -import type { Options } from "./types.js"; -import type { NodeApp } from "astro/app/node"; +import path from 'node:path'; +import url from 'node:url'; +import send from 'send'; +import type { IncomingMessage, ServerResponse } from 'node:http'; +import type { Options } from './types.js'; +import type { NodeApp } from 'astro/app/node'; /** * Creates a Node.js http listener for static files and prerendered pages. @@ -16,7 +16,7 @@ export function createStaticHandler(app: NodeApp, options: Options) { /** * @param ssr The SSR handler to be called if the static handler does not find a matching file. */ - return (req: IncomingMessage, res: ServerResponse, ssr: () => unknown) => { + return (req: IncomingMessage, res: ServerResponse, ssr: () => unknown) => { if (req.url) { let pathname = app.removeBase(req.url); pathname = decodeURI(new URL(pathname, 'http://host').pathname); @@ -39,7 +39,7 @@ export function createStaticHandler(app: NodeApp, options: Options) { ssr(); }); stream.on('headers', (_res: ServerResponse) => { - // assets in dist/_astro are hashed and should get the immutable header + // assets in dist/_astro are hashed and should get the immutable header if (pathname.startsWith(`/${options.assets}/`)) { // This is the "far future" cache header, used for static files whose name includes their digest hash. // 1 year (31,536,000 seconds) is convention. |