var express = require('express'); var router = express.Router(); var Mock = require("mockjs") var moment = require('moment') var util=require('../../public/javascripts/util') var mock=require('../../public/javascripts/mock') //获取主页信息 router.get('/main',function(req, res, next) { var data=Mock.mock({...mock.ok('获取主页信息成功'),...{ body:{ ip:Mock.Random.ip(), 'time|3600-36000':0, lastLoginTime:function (){ return moment(Date.now()-this.time*1000).format(util.dateFormat) } } }}) return res.json(data) }) module.exports=router