Skip to content

Commit 8dc94a8

Browse files
committed
Demonstrate settings inconsistency
1 parent 485c6fa commit 8dc94a8

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

admin-read-settings.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* Admin API Cannot Read Settings.
3+
*
4+
* THIS DOES NOT WORK!
5+
*/
6+
7+
if (process.argv.length < 4) {
8+
console.error('Missing an argument');
9+
process.exit(1);
10+
}
11+
12+
const url = process.argv[2];
13+
const key = process.argv[3];
14+
15+
const GhostAdminAPI = require('@tryghost/admin-api');
16+
17+
const api = new GhostAdminAPI({
18+
url,
19+
key,
20+
version: 'v2'
21+
});
22+
23+
(async function main() {
24+
let settings = await api.settings.browse();
25+
26+
console.log(settings);
27+
}());

content-read-settings.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Read Settings
3+
*
4+
*
5+
* Usage:
6+
*
7+
* node content-read-settings.js https://blah.ghost.io CONTENT_API_KEY
8+
*/
9+
10+
if (process.argv.length < 4) {
11+
console.error('Missing an argument');
12+
process.exit(1);
13+
}
14+
15+
const url = process.argv[2];
16+
const key = process.argv[3];
17+
18+
const GhostContentAPI = require('@tryghost/content-api');
19+
20+
const api = new GhostContentAPI({
21+
url,
22+
key,
23+
version: 'v2'
24+
});
25+
26+
(async function main() {
27+
let settings = await api.settings.browse();
28+
29+
console.log(settings);
30+
}());

0 commit comments

Comments
 (0)