From f5fe01edaf0d02354d6d4cd45f544bc5ed591f10 Mon Sep 17 00:00:00 2001 From: Ryan Burnette Date: Wed, 10 Apr 2019 14:17:15 +0000 Subject: [PATCH] readme --- README.md | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3dac3e1..77d21f3 100644 --- a/README.md +++ b/README.md @@ -40,14 +40,21 @@ include the `subject`. function approveDomains() { } ``` +## Configuration -## Out of the box... it just works +### Defaults + +No configuration is required. By default, you'll get a baked-in Sequelize +database running sqlite3. ```javascript -// TODO +greenlock.create({ + store: require('le-store-sequelize'), + ... +}); ``` -## Sequelize Options +### Database Connection Without `config.dbOptions`, the baked-in sequelize object uses sqlite3 with default options. If `config.dbOptions` is provided, you can configure the @@ -65,7 +72,7 @@ var store = require('le-store-sequelize')({ }); greenlock.create({ - store + store, ... }); ``` @@ -80,10 +87,23 @@ var store = require('le-store-sequelize')({ }); ``` -## Provide Your Own Database Object +### Custom Database Object -You can provide your own database object if you wish. It might not even need to -be Sequelize as long as it supports the same methods and argument objects as -are used. +You can pass in your own database object if you wish. It doesn't actually even +have to be a Sequelize database object, as long as the object responds to the +implemented methods and returns the expected results. + +```javascript +var db = new MyDatabase(); + +var store = require('le-store-sequelize')({ + db +}); + +greenlock.create({ + store, + ... +}); +``` [1]: https://www.npmjs.com/package/le-store-sequelize