Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
test: add nuxt example (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Mar 21, 2024
1 parent d32f784 commit b20239a
Show file tree
Hide file tree
Showing 16 changed files with 10,805 additions and 22 deletions.
3 changes: 0 additions & 3 deletions examples/nextjs/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ export default async function FruitsPage() {
<li key={fruit.id}>{fruit.name}</li>
))}
</ul>
<span>
Rendered on the server1 {process.platform} x {process.arch}.
</span>
</div>
);
}
24 changes: 24 additions & 0 deletions examples/nuxt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
!.env.example
75 changes: 75 additions & 0 deletions examples/nuxt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Nuxt 3 Minimal Starter

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.

## Setup

Make sure to install the dependencies:

```bash
# npm
npm install

# pnpm
pnpm install

# yarn
yarn install

# bun
bun install
```

## Development Server

Start the development server on `http://localhost:3000`:

```bash
# npm
npm run dev

# pnpm
pnpm run dev

# yarn
yarn dev

# bun
bun run dev
```

## Production

Build the application for production:

```bash
# npm
npm run build

# pnpm
pnpm run build

# yarn
yarn build

# bun
bun run build
```

Locally preview production build:

```bash
# npm
npm run preview

# pnpm
pnpm run preview

# yarn
yarn preview

# bun
bun run preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
12 changes: 12 additions & 0 deletions examples/nuxt/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script setup lang="ts">
const { data } = await useFetch<{id: number, name: string}[]>('https://demo.playwright.dev/api-mocking/api/v1/fruits?1', {
responseType: 'json',
});
</script>

<template>
<ul id="fruits">
<li v-for="fruit in data" :key="fruit.id">{{ fruit.name }}</li>
</ul>
</template>
4 changes: 4 additions & 0 deletions examples/nuxt/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true }
})
Loading

0 comments on commit b20239a

Please sign in to comment.