-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (20 loc) · 969 Bytes
/
Copy pathindex.js
File metadata and controls
23 lines (20 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// ---------------------------------------------------------------
// Main initialization module and server loader
// ---------------------------------------------------------------
var piano = require('./pianoserial');
//var piano;
var midiProcessor = require('./midiprocessor');
var app = require('./app')(piano, midiProcessor);
// Initialize the piano (serial connections)
piano.initialize(function() {
// successful init; Host the web server (environment out port or 3000)
var server = app.listen(process.env.PORT || 3000, function() {
var serverHostPort = server.address().port;
console.log('started server on port ' + serverHostPort);
});
});
// Host the web server (environment out port or 3000) (use this for testing with no piano connected)
// var server = app.listen(process.env.PORT || 3000, function() {
// var serverHostPort = server.address().port;
// console.log('started server on port ' + serverHostPort);
// });