diff options
Diffstat (limited to 'examples/container-with-vitest/src/pages')
-rw-r--r-- | examples/container-with-vitest/src/pages/[locale].astro | 20 | ||||
-rw-r--r-- | examples/container-with-vitest/src/pages/api.ts | 11 | ||||
-rw-r--r-- | examples/container-with-vitest/src/pages/index.astro | 16 |
3 files changed, 47 insertions, 0 deletions
diff --git a/examples/container-with-vitest/src/pages/[locale].astro b/examples/container-with-vitest/src/pages/[locale].astro new file mode 100644 index 000000000..b76d36d39 --- /dev/null +++ b/examples/container-with-vitest/src/pages/[locale].astro @@ -0,0 +1,20 @@ +--- +export function getStaticPaths() { + return [{ params: { locale: 'en' } }]; +} +const { locale } = Astro.params; +--- + +<html lang="en"> + <head> + <meta charset="utf-8" /> + <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> + <meta name="viewport" content="width=device-width" /> + <meta name="generator" content={Astro.generator} /> + <title>Astro</title> + </head> + <body> + <h1>Astro</h1> + <p>Locale: {locale}</p> + </body> +</html> diff --git a/examples/container-with-vitest/src/pages/api.ts b/examples/container-with-vitest/src/pages/api.ts new file mode 100644 index 000000000..c30def5bb --- /dev/null +++ b/examples/container-with-vitest/src/pages/api.ts @@ -0,0 +1,11 @@ +export function GET() { + const json = { + foo: 'bar', + number: 1, + }; + return new Response(JSON.stringify(json), { + headers: { + 'content-type': 'application/json', + }, + }); +} diff --git a/examples/container-with-vitest/src/pages/index.astro b/examples/container-with-vitest/src/pages/index.astro new file mode 100644 index 000000000..2d1410736 --- /dev/null +++ b/examples/container-with-vitest/src/pages/index.astro @@ -0,0 +1,16 @@ +--- + +--- + +<html lang="en"> + <head> + <meta charset="utf-8" /> + <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> + <meta name="viewport" content="width=device-width" /> + <meta name="generator" content={Astro.generator} /> + <title>Astro</title> + </head> + <body> + <h1>Astro</h1> + </body> +</html> |