Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

0.0.7

  • Loading branch information...
commit 27b3e2ee58ff3e8ee4908490a3d76539aae30551 1 parent 40b1b9a
James Halliday authored September 07, 2012

Showing 2 changed files with 9 additions and 2 deletions. Show diff stats Hide diff stats

  1. 2  package.json
  2. 9  server.js
2  package.json
... ...
@@ -1,6 +1,6 @@
1 1
 {
2 2
     "name" : "baudio-party",
3  
-    "version" : "0.0.6",
  3
+    "version" : "0.0.7",
4 4
     "description" : "javascript music party http server",
5 5
     "bin" : {
6 6
         "baudio-party" : "server.js"
9  server.js
@@ -67,6 +67,13 @@ var server = http.createServer();
67 67
 
68 68
 server.on('request', function (req, res) {
69 69
     res.setHeader('Access-Control-Allow-Origin', '*');
  70
+    res.setHeader(
  71
+        'Access-Control-Allow-Methods',
  72
+        'GET, POST, PUT, DELETE, OPTIONS'
  73
+    );
  74
+    if (req.method === 'OPTIONS') {
  75
+        res.end();
  76
+    }
70 77
 });
71 78
 
72 79
 server.on('request', function (req, res) {
@@ -181,7 +188,7 @@ var port = argv.port || 5000;
181 188
 console.log('http://localhost:' + port);
182 189
 server.listen(port);
183 190
 
184  
-var ps = b.play({ buffer : 512 });
  191
+var ps = b.play({ buffer : 256 });
185 192
 ps.stdout.pipe(process.stdout, { end : false });
186 193
 ps.stderr.pipe(process.stderr, { end : false });
187 194
 

0 notes on commit 27b3e2e

Please sign in to comment.
Something went wrong with that request. Please try again.