{"size": 763, "ext": "js", "max_stars_repo_path": "examples/app.js", "max_stars_repo_name": "schwarzkopfb/ellipse", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "examples/app.js", "max_issues_repo_name": "schwarzkopfb/ellipse", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "examples/app.js", "max_forks_repo_name": "schwarzkopfb/ellipse", "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": 21.1944444444, "max_line_length": 69, "alphanum_fraction": 0.5583224115}
/**
 * Created by schwarzkopfb on 15/9/12.
 */

var ellipse = require('../lib/ellipse'),
    app     = ellipse()

app.get('/', function (req, res) {
    var name = req.query.name || 'Ellipse'

    res.send('Welcome ' + name + '!')
})

app.get('/source', function (req, res) {
    // send the source code of this app
    res.sendFile(__filename)
})

app.get('/:name', function (req, res) {
    res.html('<h1>Hello ' + req.params.name + '!</h1>')
})

app.get('/:greeting/:name', function (req, res) {
    res.json({
        status: 'success',
        data: {
            greeting: req.params.greeting,
            name:     req.params.name
        }
    })
})

app.listen(3333, function () {
    console.log('server is ready to accept connections on port 3333')
})
