Could you add information into the documentation how to use webix-remote with Express.
I spent two hours to realize that it requires installed '''body-parser''' package.
Create public directory and save Webix package into public/lib/webix directory.
Create server.js file:
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: false }))
var remote = require("webix-remote");
var api = remote.server();
app.use("/api", api.express());
app.use(express.static('public'));
api.setMethod("add", function(a,b){
return a+b;
});
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});
Hi
Could you add information into the documentation how to use
webix-remote
with Express. I spent two hours to realize that it requires installed '''body-parser''' package.Below is the working sample:
Install prerequisites:
Create
public
directory and save Webix package intopublic/lib/webix
directory.Create
server.js
file:And client page
public/index.html
:Run the server:
Open browser: