Skip to content

Commit 490e557

Browse files
committed
commenting and gitignore +
1 parent cdb5b31 commit 490e557

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/node_modules
2-
*.log
2+
*.log
3+
*idea/

server.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
/*jslint node: true, nomen: true, unparam: true, es5: true */
22

33
'use strict';
4-
var express = require('express'),
5-
shell = require('shelljs'),
6-
url = require('url'),
4+
var express = require('express'), // server dep
5+
shell = require('shelljs'),// run shell commands. fixed win->linux cmds.
6+
url = require('url'),// url routing.
77

88
port = 3000,
9-
app = express();
9+
app = express(); // express object init. used to build the server.
1010

11+
// get the default route.
1112
app.get('/', function (req, res) {
12-
// '/?C will play a C note. ?Db plays a D flat note'
13-
var note = url.parse(req.url).query;
1413

14+
// '/?C will play a C note. ?Db plays a D flat note'
15+
var note = url.parse(req.url).query; // do not regex to hell.
16+
17+
// new shell process: do note playoff udp style.
1518
shell.exec('play -qn synth 2 pluck ' + note, {async:true});
19+
20+
// http response: I god you covered!
1621
res.status(200).send('Playing a note on the server!');
1722
});
1823

19-
app.listen(port);
20-
console.log('Synth started at http://localhost:' + port + '/');
24+
app.listen(port); // server init.
25+
console.log('Synth started at http://localhost:' + port + '/');

0 commit comments

Comments
 (0)