api copied to hudozka-api module based on express

This commit is contained in:
tmshv committed 2020-02-15 01:38:07 +03:00
1 parent 70007d3199
commit fc0724a900
21 files changed
+1093

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import {c} from '../core/db';
const PAGES = 'pages';
export async function getPageUrls() {
return await c(PAGES)
.find({}, {url: 1})
.toArray();
}
/**
* Find a person by it's id
*
* @param {string} url
* @returns {Promise|*}
*/
export async function getPage(url) {
return await c(PAGES).findOne({url: url});
}