mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
docs(help) example: prefix -> express mount point
This commit is contained in:
parent
f8caecf221
commit
9345d80b17
2 changed files with 7 additions and 9 deletions
10
HELP.md
10
HELP.md
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue