File tree Expand file tree Collapse file tree 2 files changed +57
-0
lines changed
Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 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+ } ( ) ) ;
Original file line number Diff line number Diff line change 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+ } ( ) ) ;
You can’t perform that action at this time.
0 commit comments