site/app.moon

30 lines
637 B
Plaintext
Raw Normal View History

2015-02-01 07:44:25 +00:00
gh = require('github').new({access_token: os.getenv "GITHUB_TOKEN", httpclient_driver: 'httpclient.ngx_driver'})
2015-02-01 01:15:41 +00:00
lapis = require "lapis"
class extends lapis.Application
layout: require "layout.bootstrap"
@include "controllers.hire"
2015-02-01 08:17:40 +00:00
@include "controllers.projects"
2015-02-02 00:33:18 +00:00
@include "controllers.go"
2015-02-01 05:37:51 +00:00
2015-02-01 01:15:41 +00:00
[index: "/"]: =>
2015-02-01 07:44:25 +00:00
@user, err = gh\get_authenticated_user()
if err
@err = err
return status: 500, render: "error"
2015-02-01 01:15:41 +00:00
render: true
2015-02-01 04:28:06 +00:00
[contact: "/contact"]: =>
2015-02-01 19:08:27 +00:00
@title = "Contact"
2015-02-01 04:28:06 +00:00
render: true
2015-02-01 05:50:21 +00:00
[error: "/error"]: =>
render: true, status: 500
2015-02-01 01:15:41 +00:00
handle_404: =>
status: 404, render: "notfound"