summaryrefslogtreecommitdiff
path: root/packages/integrations/node
diff options
context:
space:
mode:
authorGravatar matthewp <matthewp@users.noreply.github.com> 2023-05-12 14:03:42 +0000
committerGravatar fredkbot <fred+astrobot@astro.build> 2023-05-12 14:03:42 +0000
commitb064ca6539522ecf0ba476ef9de75a8d113bec0c (patch)
tree52215e9ed79dd36e244b1da50a22b3bbd986cd11 /packages/integrations/node
parent781f558c401a5f02927d150e4628a77c55cccd28 (diff)
downloadastro-b064ca6539522ecf0ba476ef9de75a8d113bec0c.tar.gz
astro-b064ca6539522ecf0ba476ef9de75a8d113bec0c.tar.zst
astro-b064ca6539522ecf0ba476ef9de75a8d113bec0c.zip
[ci] format
Diffstat (limited to 'packages/integrations/node')
-rw-r--r--packages/integrations/node/src/http-server.ts8
-rw-r--r--packages/integrations/node/test/prerender.test.js2
2 files changed, 5 insertions, 5 deletions
diff --git a/packages/integrations/node/src/http-server.ts b/packages/integrations/node/src/http-server.ts
index 2c58c0da7..177c71ed9 100644
--- a/packages/integrations/node/src/http-server.ts
+++ b/packages/integrations/node/src/http-server.ts
@@ -57,10 +57,10 @@ export function createServer(
});
stream.on('directory', () => {
// On directory find, redirect to the trailing slash
- const location = req.url + '/';
- res.statusCode = 301
- res.setHeader('Location', location);
- res.end(location);
+ const location = req.url + '/';
+ res.statusCode = 301;
+ res.setHeader('Location', location);
+ res.end(location);
});
stream.on('file', () => {
forwardError = true;
diff --git a/packages/integrations/node/test/prerender.test.js b/packages/integrations/node/test/prerender.test.js
index 1b478bb33..0ef316ed6 100644
--- a/packages/integrations/node/test/prerender.test.js
+++ b/packages/integrations/node/test/prerender.test.js
@@ -61,7 +61,7 @@ describe('Prerendering', () => {
it('Omitting the trailing slash results in a redirect that includes the base', async () => {
const res = await fetch(`http://${server.host}:${server.port}/some-base/two`, {
- redirect: 'manual'
+ redirect: 'manual',
});
expect(res.status).to.equal(301);
expect(res.headers.get('location')).to.equal('/some-base/two/');