Skip to content

Commit

Permalink
Merge pull request rwaldron#8 from rwldrn/socket-stubs
Browse files Browse the repository at this point in the history
Brings test/socket.html into style parity
  • Loading branch information
rwaldron committed Sep 11, 2011
2 parents caaae05 + a412c2e commit 0be4a4f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
12 changes: 12 additions & 0 deletions Jakefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,18 @@ task( "hint", [], function( params ) {
});
});

desc( "Run socket" );
task( "socket", [ ], function() {
try {

// Placeholder
spawn( "node", [ "socket/socket.js" ] );


} catch( ex ) {
console.log( ex.toString() );
}
});

desc( "Run server" );
task( "run", [ ], function() {
Expand Down
12 changes: 12 additions & 0 deletions socket/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io.connect( "http://localhost" );
socket.on( "news", function( data ) {

console.log( data );

socket.emit( "my other event", {
my: "data"
});
});
</script>
2 changes: 1 addition & 1 deletion lib/socket.js → socket/socket.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var app = require( "express" ).createServer(),
io = require( "socket.io" ).listen(app);

app.listen( 80 );
app.listen( 8080 );

app.get( "/", function( req, res ) {
res.sendfile( __dirname + "/index.html" );
Expand Down
8 changes: 0 additions & 8 deletions test/socket.html

This file was deleted.

0 comments on commit 0be4a4f

Please sign in to comment.