This commit is contained in:
2019-07-01 21:17:33 +02:00
parent dbca57d7e1
commit 761f766ea0
5 changed files with 18 additions and 14 deletions

View File

@@ -38,10 +38,8 @@ app.get('/type/:type/startDate/:startDate/endDate/:endDate/sample/:sample', asyn
$ne: NaN
}
}
console.time()
try {
const docs = await db.collection('dht22').find(query).toArray()
console.timeEnd()
const sampledDocs = docs
.filter((value, index) => index % sample === 0)
.map(doc => {
@@ -61,6 +59,6 @@ function dateFromObjectId(objectId) {
return Math.floor(mongo.ObjectId(objectId).getTimestamp().getTime() / 1000)
};
app.use(express.static(path.join(__dirname, 'dist')))
app.use(express.static(path.join(__dirname, '../dist')))
module.exports = app