mirror of
https://github.com/KevinMidboe/moviedb.git
synced 2025-10-29 01:30:26 +00:00
Added tool for exporting endpoints as a markdown table
This commit is contained in:
18
tools/towiki.js
Normal file
18
tools/towiki.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
var es = require('./lib/endpoints.json')
|
||||||
|
|
||||||
|
var out = []
|
||||||
|
out.push(['', 'API resource', 'Lib function name', 'HTTP method', ''].join('|'))
|
||||||
|
out.push('|---|---|---|')
|
||||||
|
Object.keys(es.methods).forEach(function(e){
|
||||||
|
var m = es.methods[e]
|
||||||
|
Object.keys(m).forEach(function(r){
|
||||||
|
out.push(['', e + r, m[r].resource, m[r].method.toUpperCase(), ''].join('|'))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
Object.keys(es.authentication).forEach(function(e){
|
||||||
|
out.push(['', e, es.authentication[e], 'POST', ''].join('|'))
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(out.join('\n'))
|
||||||
Reference in New Issue
Block a user