mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
docs(readme) Using as Middleware: add socket path
This commit is contained in:
parent
f1ec9fadb6
commit
54352af728
2 changed files with 10 additions and 6 deletions
8
HELP.md
8
HELP.md
|
|
@ -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) */
|
||||
}
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -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) */
|
||||
}
|
||||
}));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue