Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ├── app.js
- ├── client
- │ ├── css
- │ │ └── main.css
- │ ├── fonts
- │ ├── img
- │ ├── index.html
- │ ├── index.pug
- │ └── js
- │ └── main.js
- ├── package.json
- var express = require('express');
- var app = express();
- var serv = require('http').Server(app);
- app.get('/',function(req, res){
- res.sendFile(__dirname + '/client/index.html');
- });
- app.use('/client',express.static(__dirname + '/client'));
- serv.listen(8080);
- var io = require('socket.io')(serv,{});
- io.sockets.on('connection',function(socket){ //code }
- ...
- script(src='https://cdn.socket.io/socket.io-1.4.5.js')
- script.
- var socket = io();
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement