2013-08-20 09:43:18 +08:00
|
|
|
config = require("../config")
|
|
|
|
|
2014-04-24 04:18:25 +08:00
|
|
|
moduleDeps = ["App"]
|
2013-09-16 07:10:19 +08:00
|
|
|
|
2013-08-20 10:51:26 +08:00
|
|
|
# The main router that registers the routes that can be accessed by the client.
|
2013-08-20 09:43:18 +08:00
|
|
|
module.exports = class MainRouter
|
2013-09-16 07:10:19 +08:00
|
|
|
|
|
|
|
constructor: () ->
|
|
|
|
config.modules.wait moduleDeps, =>
|
|
|
|
@app = config.modules.get("App")
|
|
|
|
@_registerRoutes()
|
2013-08-20 09:43:18 +08:00
|
|
|
|
|
|
|
_registerRoutes: () ->
|
|
|
|
@app.get "/", @_index
|
|
|
|
|
2014-04-25 05:33:59 +08:00
|
|
|
# Base route to render the HTML5 client.
|
2013-10-29 01:23:15 +08:00
|
|
|
#
|
|
|
|
# This method is registered as a route on express.
|
|
|
|
#
|
|
|
|
# @internal
|
2013-09-16 07:10:19 +08:00
|
|
|
_index: (req, res) =>
|
2014-04-24 04:18:25 +08:00
|
|
|
res.render "index",
|
|
|
|
title: config.appName
|