forked from YahooArchive/mojito
/
app.js
41 lines (31 loc) · 1 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
/*jslint node:true*/
'use strict';
var debug = require('debug')('app'),
express = require('express'),
libmojito = require('../../../../'),
app;
app = express();
app.set('port', process.env.PORT || 8666);
libmojito.extend(app);
app.use(libmojito.middleware());
// To use the routing configured in `routes.json`, which
// is deprecated, you uncomment this line.
// app.mojito.attachRoutes();
app.get('/', function (req, res, next) {
req.params.view_type = "yui";
next();
}, libmojito.dispatch('tribframe.index'));
app.get('/mojito', function (req, res, next) {
req.params.view_type = "mojito";
next();
}, libmojito.dispatch('tribframe.index'));
app.listen(app.get('port'), function () {
debug('Server listening on port ' + app.get('port') + ' ' +
'in ' + app.get('env') + ' mode');
});
module.exports = app;