filter with date ; working backend and frontend

This commit is contained in:
GotPPay
2017-12-11 18:22:06 +01:00
parent b634bfd300
commit 6859ba39be
26 changed files with 128932 additions and 12 deletions

View File

@@ -1,6 +1,23 @@
const express = require('express');
const config = require('./config');
var MongoClient = require ('mongodb').MongoClient;
var ObjectID = require ('mongodb').ObjectID;
const app = express();
app.listen(config.PORT, ()=>{console.log('Server running on port ' + config.PORT)});
app.get('/list', (req,res)=>{
res.header ('Access-Control-Allow-Origin', '*');
db.collection('expired_list').find({}).toArray((err,result)=>{
if (err){
res.send(JSON.stringify(null));
}else{
res.send(JSON.stringify(result));
}
});
});
MongoClient.connect (config.databaseURL).then (database => {
db = database;
app.listen(config.PORT, ()=>{console.log('Server running on port ' + config.PORT)});
});