Skip to content

Instantly share code, notes, and snippets.

@ptrin
Created June 6, 2014 00:10
Show Gist options
  • Select an option

  • Save ptrin/fbecb6e32e403a343e0a to your computer and use it in GitHub Desktop.

Select an option

Save ptrin/fbecb6e32e403a343e0a to your computer and use it in GitHub Desktop.

Revisions

  1. ptrin revised this gist Jun 6, 2014. 1 changed file with 6 additions and 8 deletions.
    14 changes: 6 additions & 8 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -5,17 +5,15 @@ var bodyParser = require('body-parser'),

    var app = express();
    var server = http.createServer(app);
    app.use(bodyParser());
    app.use(express.static(__dirname+'/test-ui'));
    app.use(
    bodyParser.json(),
    express.static(__dirname+'/test-ui')
    );

    var ipaddress = "127.0.0.1";
    var port = 3000;
    app.listen(port, ipaddress);
    app.listen(3000);

    /*
    var io = sio.listen(server);

    io.sockets.on('connection', function(socket) {
    console.log( 'Someone connected' );
    });
    */
    });
  2. ptrin revised this gist Jun 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ var bodyParser = require('body-parser'),

    var app = express();
    var server = http.createServer(app);
    app.use(bodyParser.json());
    app.use(bodyParser());
    app.use(express.static(__dirname+'/test-ui'));

    var ipaddress = "127.0.0.1";
  3. ptrin revised this gist Jun 6, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,9 @@ var server = http.createServer(app);
    app.use(bodyParser.json());
    app.use(express.static(__dirname+'/test-ui'));

    app.listen(3000);
    var ipaddress = "127.0.0.1";
    var port = 3000;
    app.listen(port, ipaddress);

    /*
    var io = sio.listen(server);
  4. ptrin revised this gist Jun 6, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -10,8 +10,10 @@ app.use(express.static(__dirname+'/test-ui'));

    app.listen(3000);

    /*
    var io = sio.listen(server);
    io.sockets.on('connection', function(socket) {
    console.log( 'Someone connected' );
    });
    });
    */
  5. ptrin revised this gist Jun 6, 2014. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -5,10 +5,8 @@ var bodyParser = require('body-parser'),

    var app = express();
    var server = http.createServer(app);
    app.use(
    bodyParser.json(),
    express.static(__dirname+'/test-ui')
    );
    app.use(bodyParser.json());
    app.use(express.static(__dirname+'/test-ui'));

    app.listen(3000);

  6. ptrin created this gist Jun 6, 2014.
    19 changes: 19 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    var bodyParser = require('body-parser'),
    express = require('express'),
    http = require('http'),
    sio = require('socket.io');

    var app = express();
    var server = http.createServer(app);
    app.use(
    bodyParser.json(),
    express.static(__dirname+'/test-ui')
    );

    app.listen(3000);

    var io = sio.listen(server);

    io.sockets.on('connection', function(socket) {
    console.log( 'Someone connected' );
    });