mirror of
https://github.com/withastro/astro.git
synced 2025-03-10 23:01:26 -05:00
nit: use node:
prefix everywhere (#7692)
* nit: use `node:` prefix everywhere * nit: fs/promises too * test: workaround issue in node builtin detection
This commit is contained in:
parent
0d92624942
commit
a1a8491832
2 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,7 @@ import type { AstroAdapter, AstroConfig, AstroIntegration, RouteData } from 'ast
|
|||
import glob from 'fast-glob';
|
||||
import { basename } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { pathToFileURL } from 'url';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
import {
|
||||
defaultImageConfig,
|
||||
getImageConfig,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { existsSync } from 'fs';
|
||||
import { existsSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
import { ASTRO_LOCALS_HEADER } from './adapter.js';
|
||||
|
@ -62,12 +62,12 @@ import { onRequest } from ${middlewarePath};
|
|||
import { createContext, trySerializeLocals } from 'astro/middleware';
|
||||
export default async function middleware(request, context) {
|
||||
const url = new URL(request.url);
|
||||
const ctx = createContext({
|
||||
const ctx = createContext({
|
||||
request,
|
||||
params: {}
|
||||
});
|
||||
ctx.locals = ${handlerTemplateCall};
|
||||
const next = async () => {
|
||||
const next = async () => {
|
||||
const response = await fetch(url, {
|
||||
headers: {
|
||||
${JSON.stringify(ASTRO_LOCALS_HEADER)}: trySerializeLocals(ctx.locals)
|
||||
|
|
Loading…
Add table
Reference in a new issue