mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 22:30:15 +00:00
Write DB to application directory
This commit is contained in:
parent
24abf6f71f
commit
9fda6e79cf
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,9 +3,6 @@ node_modules
|
||||
dist/*
|
||||
build/*
|
||||
|
||||
# PouchDB stuff
|
||||
*db.json
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
@ -1,3 +1,6 @@
|
||||
import * as fsPath from 'path'
|
||||
import electron from 'electron'
|
||||
|
||||
// import PouchDB from 'pouchdb';
|
||||
import * as methods from '../lib/constants';
|
||||
import {generateId} from './util'
|
||||
@ -28,7 +31,8 @@ export function initDB () {
|
||||
}
|
||||
|
||||
return new Promise(resolve => {
|
||||
db = new Loki('insomnia.db.json', {
|
||||
const rootPath = electron.remote.app.getPath('appData');
|
||||
db = new Loki(fsPath.join(rootPath, 'insomnia.db.json'), {
|
||||
autoload: true,
|
||||
autosave: true,
|
||||
autosaveInterval: 500, // TODO: Make this a bit smarter maybe
|
||||
|
Loading…
Reference in New Issue
Block a user