Skip to content

Commit

Permalink
docs(fix): database preset initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
sandros94 committed May 30, 2024
1 parent d304f4a commit cc5a493
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ export default defineNuxtConfig({
pass: 'root'
}
},
production: {},
production: {
host: '', // initialize any property that will be set via `.env`
NS: '',
DB: ''
},
},
},
// ...
Expand Down
7 changes: 6 additions & 1 deletion playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ export default defineNuxtConfig({
modules: ['nuxt-surrealdb'],
surrealdb: {
databases: {
staging: {},
staging: {
host: '',
NS: '',
DB: '',
auth: '',
},
},
},
devtools: { enabled: true },
Expand Down
3 changes: 1 addition & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ export default defineNuxtModule<ModuleOptions>({
name: 'nuxt-surrealdb',
configKey: 'surrealdb',
},
// Default configuration options of the Nuxt module
defaults: {
databases: {
default: {
host: '',
NS: '',
DB: '',
auth: undefined,
auth: '',
},
},
tokenCookieName: 'surrealdb_token',
Expand Down

0 comments on commit cc5a493

Please sign in to comment.