Skip to content

Commit

Permalink
index: add /data endpoint to get data through a JSON API
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Jul 20, 2016
1 parent 1f14de0 commit 7bccd73
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,20 @@ export default function slackin ({
res.send(page.toHTML())
})

app.get('/data', (req, res) => {
let { name, logo } = slack.org
let { active, total } = slack.users
res.send({
name,
org,
coc,
logo,
channels,
active,
total
})
})

// static files
app.use('/assets', express.static(assets))

Expand Down

0 comments on commit 7bccd73

Please sign in to comment.