Skip to content

Commit

Permalink
chore(defaults)!: Set fs as default storage driver
Browse files Browse the repository at this point in the history
  • Loading branch information
becem-gharbi committed Nov 14, 2023
1 parent 761f13e commit a2af160
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ Network Trash Folder
Temporary Items
.apdisk

demo
uploads/
demo
uploads/
10 changes: 3 additions & 7 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { defu } from 'defu'
// Module options TypeScript interface definition
interface ModuleOptionsFS {
driver: 'fs';
fsBase: string;
fsBase?: string;
accept?: string;
maxSizeMb?: number;
}
Expand All @@ -37,12 +37,8 @@ export default defineNuxtModule<ModuleOptions>({
},

defaults: {
driver: 's3',
accessKeyId: '',
bucket: '',
endpoint: '',
region: '',
secretAccessKey: ''
driver: 'fs',
fsBase: './uploads'
},

setup (options, nuxt) {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/server/plugins/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default defineNitroPlugin((nitroApp) => {

if (config.s3.driver === 'fs') {
storage = createStorage({
driver: fsLiteDriver({ base: config.s3.fsBase || './uploads' })
driver: fsLiteDriver({ base: config.s3.fsBase })
})
} else if (config.s3.driver === 's3') {
const client = new AwsClient({
Expand Down

0 comments on commit a2af160

Please sign in to comment.