-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
84 lines (78 loc) · 1.98 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
83
84
var connect = require('connect');
var ex_menu = [
{
type: 'link_list',
label: 'Main Menu',
items: [
{label: 'Services', href: '/services'},
{label: 'Hosts', href: '/hosts'},
{label: 'Problems', href: '/problems'},
{label: 'Help', href: '/help'}
]
},
{
type: 'widget_list',
label: 'Widgets',
items_url: '/widgets'
}
];
var ex_tabs = [
{
id: 'tab20100702',
label: 'First Tab',
windows: [
{
id: 'calendar20100702',
type: 'calendar',
label: 'My Calendar',
x: 10, y: 10, width: 100, height: 50
},
{
id: 'rss20100702',
type: 'rss',
label: 'My RSS',
x: 50, y: 50, width: 200, height: 100,
feed: 'http://mysss.org/feed.rss'
}
]
},
{
id: 'tab2010070021',
label: 'Second tab',
windows: {
}
}
];
var ex_widgets = [
{
name: 'calendar',
label: 'Calendar',
icon: 'calendar.png',
},
{
name: 'rss',
label: 'RSS',
icon: 'rss.png'
}
];
var server = module.exports = connect.createServer();
server.use('/',
connect.bodyDecoder(),
//connect.cookieDecoder(),
//connect.session({
// store: new MemoryStore({ reapInterval: minute, maxAge: minute * 500 })
//}),
connect.compiler({ src: __dirname + '/public', enable: ['less'] }),
connect.staticProvider(__dirname + '/public'),
connect.router(function(app) {
app.get('/widgets', function(req, resp) {
resp.simpleBody(200, ex_widgets);
});
app.get('/menu', function(req, resp) {
resp.simpleBody(200, ex_menu);
});
app.get('/tabs', function(req, resp) {
resp.simpleBody(200, ex_tabs);
});
})
);