Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update serverAssets example #1156

Merged
merged 3 commits into from
Apr 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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' // {srcDir}/templates
pi0 marked this conversation as resolved.
Show resolved Hide resolved
}]
})
```
Expand All @@ -115,7 +115,7 @@ export default defineNuxtConfig({
nitro: {
serverAssets: [{
baseName: 'templates',
dir: './server/templates'
dir: './templates' // {srcDir}/server/templates
pi0 marked this conversation as resolved.
Show resolved Hide resolved
}]
}
})
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`)
})
```