docs(readme) Using as Middleware: add socket path

This commit is contained in:
coderaiser 2016-02-20 11:50:24 -05:00
parent f1ec9fadb6
commit 54352af728
2 changed files with 10 additions and 6 deletions

View file

@ -280,17 +280,19 @@ var http = require('http'),
app = express(),
PORT = 1337,
PREFIX = '/cloudcmd',
server,
socket;
server = http.createServer(app);
socket = io.listen(server);
socket = io.listen(server, {
path: PREFIX + '/socket.io'
});
app.use(cloudcmd({
socket: socket, /* used by Config, Edit (optional) and Console (required) */
config: { /* config data (optional) */
prefix: '/cloudcmd', /* base URL or function which returns base URL (optional) */
prefix: PREFIX, /* base URL or function which returns base URL (optional) */
}
}));

View file

@ -63,17 +63,19 @@ var http = require('http'),
app = express(),
PORT = 1337,
PREFIX = '/cloudcmd',
server,
socket;
server = http.createServer(app);
socket = io.listen(server);
socket = io.listen(server, {
path: PREFIX + '/socket.io'
});
app.use(cloudcmd({
socket: socket, /* used by Config, Edit (optional) and Console (required) */
config: { /* config data (optional) */
prefix: '/cloudcmd', /* base URL or function which returns base URL (optional) */
prefix: PREFIX, /* base URL or function which returns base URL (optional) */
}
}));