-
Notifications
You must be signed in to change notification settings - Fork 19
/
app.js
executable file
·82 lines (71 loc) · 2.43 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
* Copyright(c) 2012 by CoNarrative
*/
var express = require('express');
var jade = require('jade');
var fs = require('fs');
var app = express.createServer();
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(__dirname));
app.set('view options', { //turn off layouts for now...
layout:false
});
//routes
//root
app.get('/', function (req, res) {
var markdown = fs.readFileSync('README.md', 'ascii');
res.render('index.jade',{});
});
//main specs
app.get('/spec/extjs3', function (req, res) {
res.render('runner.jade', {locals:{extjs_version: 3}});
});
app.get('/spec/extjs4', function (req, res) {
res.render('runner.jade', {locals:{extjs_version: 4}});
});
//examples
//app.get('/examples/assets/extjs3', function (req, res) {
// res.render('assets.jade', {locals:{extjs_version: 3}});
//});
app.get('/examples/assets/extjs4', function (req, res) {
res.render('assets.jade', {locals:{extjs_version: 4}});
});
app.get('/examples/assets/spec', function (req, res) {
res.render('assetsRunner.jade', {locals:{extjs_version: 4}});
});
app.get('/examples/todomvc/extjs4', function (req, res) {
res.render('todo.jade', {locals:{extjs_version: 4}});
});
app.get('/examples/todomvc/spec', function (req, res) {
res.render('todoRunner.jade', {locals:{extjs_version: 4}});
});
app.get('/examples/helloworld/extjs3', function (req, res) {
res.render('helloworld.jade', {locals:{extjs_version: 3}});
});
app.get('/examples/helloworld/extjs4', function (req, res) {
res.render('helloworld.jade', {locals:{extjs_version: 4}});
});
//app.get('/examples/medical/extjs4', function (req, res) {
// res.render('medical.jade', {locals:{extjs_version:4}});
//});
//app.get('/examples/medical/spec', function (req, res) {
// res.render('medicalRunner.jade', {locals:{extjs_version:4}});
//});
//Sencha Touch (Experimental)
app.get('/examples/senchatouch/simple/index.html',function(req,res){
res.render('senchatouch-school-1.jade',{title:''});
});
app.get('/examples/senchatouch/school/index.html',function(req,res){
res.render('senchatouch-school-1.jade',{title:''});
});
app.get('/spec/touch2',function(req,res){
res.render('senchatouch-runner.jade',{title:''});
});
//startup
var port = process.env.PORT || 8123;
app.listen(port, function () {
console.log('GluJS development website listening on http://localhost:' + port);
});