From 07d437da3db1454bfc0aa35df41d76e7462881fd Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Sat, 23 Mar 2024 19:54:27 +0900 Subject: [PATCH] fixed root --- astro-fastify-ssg/server.js | 4 +++- astro-fastify/server.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/astro-fastify-ssg/server.js b/astro-fastify-ssg/server.js index 1f66e4f..6a0f0ae 100644 --- a/astro-fastify-ssg/server.js +++ b/astro-fastify-ssg/server.js @@ -7,7 +7,9 @@ const app = async (fastify, opts) => { if (opts.dev) { const astro = await import("astro"); - const astroDevServer = await astro.dev(); + const astroDevServer = await astro.dev({ + root: fileURLToPath(import.meta.resolve(".")), + }); await fastify.register(await import("@fastify/http-proxy"), { upstream: `http://localhost:${astroDevServer.address.port}`, }); diff --git a/astro-fastify/server.js b/astro-fastify/server.js index ae84a5f..c52a06f 100644 --- a/astro-fastify/server.js +++ b/astro-fastify/server.js @@ -8,7 +8,9 @@ const app = async (fastify, opts) => { if (opts.dev) { const astro = await import("astro"); - const astroDevServer = await astro.dev(); + const astroDevServer = await astro.dev({ + root: fileURLToPath(import.meta.resolve(".")), + }); await fastify.register(await import("@fastify/http-proxy"), { upstream: `http://localhost:${astroDevServer.address.port}`, });