forked from HadoukenIO/fdc3-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
26 lines (20 loc) · 900 Bytes
/
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
const openfinLauncher = require('hadouken-js-adapter');
const express = require('express');
const os = require('os')
const app = express();
const path = require('path');
const http = require('http');
const appsConf = path.resolve('./build/demo/configs/app-launcher.json');
const port = process.env.port || 3012
app.use(express.static('./build'));
http.createServer(app).listen(port, () => {
console.log(`Server running on port: ${port}`);
// launch the main demo apps launcher
openfinLauncher.launch({ manifestUrl: appsConf }).catch(err => console.log(err));
// on OS X we need to launch the provider manually (no RVM)
if (os.platform() === 'darwin') {
console.log("Starting Provider for Mac OS");
const providerConf = path.resolve('./build/app.json');
openfinLauncher.launch({ manifestUrl: providerConf }).catch(err => console.log(err));
}
});