Skip to content

Commit

Permalink
Add Copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
a632079 committed Jan 29, 2018
1 parent 7a9a67a commit e86f769
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions src/controllers/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,30 @@ async function getPastDay () {
return requests
}

module.exports = {
status: async (ctx, next) => {
const now = await getRequests()
const pastMinute = await getPastMinute()
const pastHour = await getPastHour()
const pastDay = await getPastDay()
ctx.body = {
requests: {
all: parseInt(now),
pastMinute: parseInt(now) - parseInt(pastMinute),
pastHour: parseInt(now) - parseInt(pastHour),
pastDay: parseInt(now) - parseInt(pastDay)
},
now: new Date(Date.now()).toString(),
ts: Date.now()
}
module.exports = async (ctx, next) => {
const pkg = require(path.join('../../', 'package'))
const now = await getRequests()
const pastMinute = await getPastMinute()
const pastHour = await getPastHour()
const pastDay = await getPastDay()
ctx.body = {
name: pkg.name,
version: pkg.version,
message: 'Love us? donate at http://hitokoto.cn/donate',
website: 'http://hitokoto.cn',
requests: {
all: parseInt(now),
pastMinute: parseInt(now) - parseInt(pastMinute),
pastHour: parseInt(now) - parseInt(pastHour),
pastDay: parseInt(now) - parseInt(pastDay)
},
feedback: {
Kuertianshi: 'i@loli.online',
freejishu: 'i@freejishu.com',
a632079: 'a632079@qq.com'
},
copyright: 'MoeCraft All Rights Reserved. Powered by Teng-koa ( https://github.com/a632079/teng-koa ).',
now: new Date(Date.now()).toString(),
ts: Date.now()
}
}

0 comments on commit e86f769

Please sign in to comment.