-
Notifications
You must be signed in to change notification settings - Fork 10
/
sample_server_config.js
51 lines (38 loc) · 1.25 KB
/
sample_server_config.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
var g = require('./lib/garçon'),
server, myApp;
// create a server which will listen on port 8000 by default
server = new g.Server();
// adding an application named 'myapp' tells the server to respond to
// the /myapp url and to create a myapp.html file when saving
myApp = server.addApp({
name: 'myapp',
theme: 'sc-theme',
buildLanguage: 'english'
});
// myApp needs SproutCore to run
myApp.addSproutcore();
// add other dependencies
myApp.addFrameworks(
// a third party framework
// { path: 'frameworks/calendar' },
// the theme you're using
{ path:'frameworks/sproutcore/themes/standard_theme', combineScripts: true },
// if you're on Quilmes and use Ace, uncomment the next 2 lines instead
// { path:'frameworks/sproutcore/themes/empty_theme', combineScripts: true },
// { path:'frameworks/sproutcore/themes/ace', combineScripts: true },
// finally, the sources for myApp must be added as well
{ path: 'apps/' + myApp.name }
);
// add some html for inside the <head> tag
myApp.htmlHead = '<title>My App</title>';
// add some html for inside the <body> tag
myApp.htmlBody = [
'<p id="loading">',
'Loading…',
'</p>'
].join('\n');
// build the app
myApp.build(function() {
// run the server
server.run();
});