Getting Started
Here is a simple guide to setting up Nuxt File Storage in your project.
Play online
You can play with Nuxt File Storage in your browser using Stackblitz:
Play on StackBlitzAdd to your project
- Go to your project and type in:
bash
npx nuxi@latest module add nuxt-file-storage
- add
nuxt-file-storage
to your modules:
nuxt.config.ts
export default defineNuxtConfig({
modules: ['nuxt-file-storage'],
})
- add the absolute
mount
location:
nuxt.config.ts
export default defineNuxtConfig({
modules: ['nuxt-file-storage'],
fileStorage: {
mount: process.env.mount
},
})
You should definitely use Environment Variables
.env
instead of hard-coding your mount to differentiate between local development and deployment and to not expose your file system structure to your project.Table of Contents