formatting

This commit is contained in:
Jakub Sokołowski 2018-11-14 16:45:05 +01:00
parent 9d32799486
commit 792f61d55e
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 4 additions and 4 deletions

View File

@ -21,16 +21,16 @@ app.on('error', (err, ctx) => {
}); });
router.put('/clicks/:id', async ctx => { router.put('/clicks/:id', async ctx => {
counter.incr(ctx.params.id) counter.incr(ctx.params.id)
ctx.body = { [ctx.params.id]: await counter.state(ctx.params.id) } ctx.body = { [ctx.params.id]: await counter.state(ctx.params.id) }
}); });
router.get('/clicks', async ctx => { router.get('/clicks', async ctx => {
ctx.body = await counter.list() ctx.body = await counter.list()
}); });
router.get('/clicks/:id', async ctx => { router.get('/clicks/:id', async ctx => {
ctx.body = { [ctx.params.id]: await counter.state(ctx.params.id) } ctx.body = { [ctx.params.id]: await counter.state(ctx.params.id) }
}); });
app.use(Logger()) app.use(Logger())