24 lines
587 B
JavaScript
24 lines
587 B
JavaScript
var express = require('express');
|
|
var Promise = require('bluebird');
|
|
var router = express.Router();
|
|
var models_eco_v1 = require('../model/sjy_eco_v1.js');
|
|
|
|
|
|
|
|
router.get('/', function (req, res, next) {
|
|
Promise.all([
|
|
models_eco_v1.getTop10Metadata(),
|
|
models_eco_v1.getLast10Metadata()
|
|
]).then(function(results) {
|
|
res.render('data', {
|
|
metadatas: results[0],
|
|
latestMetadatas: results[1],
|
|
page_title: '数据管理'
|
|
});
|
|
}).catch(function(err) {
|
|
console.error(err);
|
|
});
|
|
});
|
|
|
|
module.exports = router;
|