json-server 0.14.1 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/lib/server/router/index.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -308,7 +308,7 @@ __Tip__ use modules like [Faker](https://github.com/Marak/faker.js), [Casual](ht
|
|
|
308
308
|
|
|
309
309
|
### HTTPS
|
|
310
310
|
|
|
311
|
-
There
|
|
311
|
+
There are many ways to set up SSL in development. One simple way is to use [hotel](https://github.com/typicode/hotel).
|
|
312
312
|
|
|
313
313
|
### Add custom routes
|
|
314
314
|
|
|
@@ -12,7 +12,7 @@ const low = require('lowdb');
|
|
|
12
12
|
|
|
13
13
|
const Memory = require('lowdb/adapters/Memory');
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const FileSync = require('lowdb/adapters/FileSync');
|
|
16
16
|
|
|
17
17
|
const bodyParser = require('../body-parser');
|
|
18
18
|
|
|
@@ -31,7 +31,7 @@ module.exports = (db, opts = {
|
|
|
31
31
|
_isFake: false
|
|
32
32
|
}) => {
|
|
33
33
|
if (typeof db === 'string') {
|
|
34
|
-
db = low(new
|
|
34
|
+
db = low(new FileSync(db));
|
|
35
35
|
} else if (!_.has(db, '__chain__') || !_.has(db, '__wrapped__')) {
|
|
36
36
|
db = low(new Memory()).setState(db);
|
|
37
37
|
} // Create router
|