docs(help) example: prefix -> express mount point

This commit is contained in:
coderaiser 2018-10-26 12:03:16 +03:00
parent f8caecf221
commit 9345d80b17
2 changed files with 7 additions and 9 deletions

10
HELP.md
View file

@ -578,17 +578,15 @@ const io = require('socket.io');
const app = require('express')();
const port = 1337;
const prefix = '/cloudcmd';
const socketPrefix = '/cloudcmd-sockets';
const prefix = '/';
const server = http.createServer(app);
const socket = io.listen(server, {
path: `${prefix}/socket.io`
path: `{prefix}socket.io`
});
const config = {
prefix, // base URL or function which returns base URL (optional)
socketPrefix, // prefix for socket connection
name: 'cloudcmd :)'
};
const plugins = [
@ -608,7 +606,7 @@ const modules = {
filePicker,
};
app.use(cloudcmd({
app.use(prefix, cloudcmd({
socket, // used by Config, Edit (optional) and Console (required)
config, // config data (optional)
plugins, // optional

View file

@ -79,7 +79,7 @@ const io = require('socket.io');
const app = require('express')();
const port = 1337;
const prefix = '/cloudcmd';
const prefix = '/';
const server = http.createServer(app);
const socket = io.listen(server, {
@ -87,7 +87,7 @@ const socket = io.listen(server, {
});
const config = {
prefix // base URL or function which returns base URL (optional)
name: 'cloudcmd :)',
};
const plugins = [
@ -107,7 +107,7 @@ const modules = {
filePicker,
};
app.use(cloudcmd({
app.use(prefix, cloudcmd({
socket, // used by Config, Edit (optional) and Console (required)
config, // config data (optional)
plugins, // optional