{"size": 438, "ext": "js", "max_stars_repo_path": "server.js", "max_stars_repo_name": "mmwtsn/borowitz-index", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server.js", "max_issues_repo_name": "mmwtsn/borowitz-index", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server.js", "max_forks_repo_name": "mmwtsn/borowitz-index", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.0526315789, "max_line_length": 72, "alphanum_fraction": 0.6552511416}
import express from 'express'
import request from 'request'
import {parse, count} from './helpers'

const app = express()

app.set('view engine', 'jade')
app.use(express.static('public'))

app.get('/', (req, res) => {
  request('http://www.newyorker.com/popular', (err, response, html) => {
    if (err || response.statusCode !== 200) throw err

    res.render('index', { borowitz_index: count(parse(html)) })
  })
})

export default app
