-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathserver.js
53 lines (42 loc) · 1.22 KB
/
server.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
// We include server.js in the top level to simplify deployment on heroku
var system = require('system');
addToClasspath('./jars/owltools-runner-all.jar');
var OWL = require('./lib/owl.js').OWL;
var stick = require('stick');
var fs = require('fs');
var response = require('ringo/jsgi/response');
var httpclient = require('ringo/httpclient');
var owl = new OWL();
var session = {
foo: 1,
owl: owl
}
owl.loadFile("test/caro.owl");
var app = exports.app = new stick.Application();
app.configure('route');
app.configure('params');
app.configure('static');
var owlservices = require('./lib/owljs/owlservices.js');
var addons = require('./lib/owljs/addons.js');
print("owl is :"+session.owl);
var myOwlservices = new owlservices.OWLServices(app,session);
new addons.AddOns(app,session);
//myOwlservices.install();
function main(args) {
print("args="+args);
if (false) {
while(args.length > 0) {
var arg = args.shift();
if (arg == "--") {
break;
}
print("Arg="+arg);
}
}
require('ringo/httpserver').main(module.id);
}
// INITIALIZATION
// Can set port from command line. E.g. --port 8080
if (require.main == module) {
main(system.args);
}