MicroServer
JavaScript WebSocket file server for the Micro Editor and other online systems.
View the Wiki for detailed usage and configuration information.
Installing
This server requires npm (and by extension, node.js). Ensure these are installed:
npm -v
node -v
- Clone the repository
git clone https://github.com/knicholson32/MicroServer.git
- Move to inside the created folder
cd MicroServer
- Initialize packages
npm i
Create MicroServer
/* main.js */
const MicroServer = require('./host');
let users = [{
name: 'user1',
pass: 'pass1',
folder: './',
permission: 'read-write'
}];
let ms = new MicroServer({
port: 8081, // Port to bind websocket server
max_clients: 2, // Max number of allowed clients
directory: './files', // Storage location
log: './.log', // Log location
ssl: false, // Use SSL to encrypt websocket
users: users
});
ms.start();
Running
node main.js