Backend
This commit is contained in:
parent
15d4e2f126
commit
edcd4dcaa0
15 changed files with 1195 additions and 82 deletions
|
|
@ -1,9 +1,21 @@
|
|||
const package = require('../package.json');
|
||||
|
||||
module.exports = (req, res) => {
|
||||
module.exports = async (req, res) => {
|
||||
let eventCount = null;
|
||||
let personCount = null;
|
||||
|
||||
try {
|
||||
const query = req.datastore.createQuery(['__Stat_Kind__']);
|
||||
|
||||
eventCount = (await req.datastore.runQuery(query.filter('kind_name', 'Event')))[0].count;
|
||||
personCount = (await req.datastore.runQuery(query.filter('kind_name', 'Person')))[0].count;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
res.send({
|
||||
eventCount: 0,
|
||||
personCount: 0,
|
||||
eventCount: eventCount || null,
|
||||
personCount: personCount || null,
|
||||
version: package.version,
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue