Change location of database.

This commit is contained in:
Koen Kanters
2018-04-08 16:41:42 +02:00
parent 658b3624ac
commit 3f4fc31835
3 changed files with 9 additions and 2 deletions
+2 -1
View File
@@ -57,4 +57,5 @@ typings/
# dotenv environment variables file
.env
package-lock.json
# data
data/database.db
View File
+7 -1
View File
@@ -41,7 +41,13 @@ const args = parser.parseArgs();
// Setup client
console.log(`Connecting to MQTT server at ${args.mqtt}`)
const client = mqtt.connect(args.mqtt)
const shepherd = new ZShepherd(args.device, {net: {panId: 0x1a62}});
const shepherd = new ZShepherd(
args.device,
{
net: {panId: 0x1a62},
dbPath: `${__dirname}/data/database.db`
}
);
// Register callbacks
client.on('connect', handleConnect);