define([ "dojo/_base/array", "dojo/node!express", "dojo/node!fs", "dojo/node!https", "dojo/node!path", "dojo/node!simple-http-proxy" ], function(array, express, fs, https, path, proxy) { function staticFile(request, response) { response.sendfile(__dirname+request.path); } var __dirname = path.resolve('.'); var httpsOptions = { key: fs.readFileSync('qed-server.key'), cert: fs.readFileSync('qed-server.pem') }; var app = express(); app.use(express.logger()); app.use(express.compress()); app.use(express.favicon()); app.get('/', function(request, response){ response.sendfile(__dirname+'/index.html'); }); app.get('/*.html', staticFile); array.forEach(['/dojo', '/dijit', '/dojox', '/qed', '/qed-client'], function(dir){ app.use(dir, express.static(__dirname+dir)); }); app.use('/data/couch', proxy('http://localhost:5984/qed')); var server = https.createServer(httpsOptions, app).listen(8443); console.log("Listening on https://localhost:8443/"); });