const common = require('./common') const Tree = window.__nfptree && window.__nfptree.tree || [] exports.Tree = Tree exports.getTree = function() { return common.sendRequest({ method: 'GET', url: '/api/pagetree', }) } exports.getPage = function(path, page) { return common.sendRequest({ method: 'GET', url: '/api/' + (path ? 'pages/' + path : 'frontpage') + '?page=' + (page || 1), }) }