index.js 592 Bytes
var express = require('express');
var router = express.Router();
var AppDb=require('../database/db.js');


/* GET query home page. */
router.get('/', function(req, res) {
    res.render('index', { title: 'query' });
});

/*result*/
router.get('/result', function(req, res) {
    res.render('result', { title: 'login' });
});

/*ucenter*/
router.post('/query', function(req, res) {
    var query_params = req.body;
    AppDb.findByParams(query_params,function(err,obj){
        // res.send(obj);
        res.render('result', {title: 'result', user:obj });
    })
});

module.exports = router;