Skip to content

Commit

Permalink
docs: update serverAssets example (#1156)
Browse files Browse the repository at this point in the history
  • Loading branch information
maou-shonen authored Apr 17, 2023
1 parent a64dcc5 commit 490f0ab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/content/1.guide/6.assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ import { defineNitroConfig } from 'nitropack'
export default defineNitroConfig({
serverAssets: [{
baseName: 'templates',
dir: './server/templates'
dir: './templates' // Relative to `srcDir` (`server/` for nuxt)
}]
})
```
Expand All @@ -115,7 +115,7 @@ export default defineNuxtConfig({
nitro: {
serverAssets: [{
baseName: 'templates',
dir: './server/templates'
dir: './templates' // Relative to `srcDir` (`server/` for nuxt)
}]
}
})
Expand All @@ -126,5 +126,7 @@ export default defineNuxtConfig({
// routes/success.ts
export default defineEventHandler(async (event) => {
return await useStorage().getItem(`assets/templates/success.html`)
// or
return await useStorage('assets:templates').getItem(`success.html`)
})
```

0 comments on commit 490f0ab

Please sign in to comment.