[ci] format
This commit is contained in:
parent
294122b4e4
commit
fa48d01109
1 changed files with 7 additions and 7 deletions
|
@ -28,21 +28,21 @@ export function start(manifest: SSRManifest, options: Options) {
|
||||||
Reflect.set(request, Symbol.for('astro.clientAddress'), ip);
|
Reflect.set(request, Symbol.for('astro.clientAddress'), ip);
|
||||||
return await app.render(request);
|
return await app.render(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the request path wasn't found in astro,
|
// If the request path wasn't found in astro,
|
||||||
// try to fetch a static file instead
|
// try to fetch a static file instead
|
||||||
const url = new URL(request.url);
|
const url = new URL(request.url);
|
||||||
const localPath = new URL('.' + url.pathname, clientRoot);
|
const localPath = new URL('.' + url.pathname, clientRoot);
|
||||||
const fileResp = await fetch(localPath.toString());
|
const fileResp = await fetch(localPath.toString());
|
||||||
|
|
||||||
// If the static file can't be found
|
// If the static file can't be found
|
||||||
if (fileResp.status == 404) {
|
if (fileResp.status == 404) {
|
||||||
// Render the astro custom 404 page
|
// Render the astro custom 404 page
|
||||||
return await app.render(request);
|
return await app.render(request);
|
||||||
|
|
||||||
// If the static file is found
|
// If the static file is found
|
||||||
} else {
|
} else {
|
||||||
return fileResp;
|
return fileResp;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue