Starting SQL adapters from the HTTP server
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.Dashboards.JS can connect to SQL databases (MySQL, PostgreSQL, MS SQL and others) through a small Node.js data-adapter service.
Run the adapter as an HTTP server.
How it works. The browser-side engine posts data commands to this Node service, which runs the actual SQL and streams results back — bridging client dashboards to server databases.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:

Run the adapter as an HTTP server.
var http = require("http");
var adapter = require("stimulsoft-data-adapter");
function accept(request, response) {
response.setHeader("Access-Control-Allow-Origin", "*");
var data = "";
request.on('data', buffer => data += buffer);
request.on('end', function () {
var command = adapter.getCommand(data);
adapter.process(command, result => response.end(adapter.getResponse(result)));
});
}
http.createServer(accept).listen(9615);stimulsoft-data-adapter— Node package that executes the SQL commands the dashboard engine sends.- On the client set
StiOptions.WebServer.url = "http://localhost:9615"to route data through this service.
How it works. The browser-side engine posts data commands to this Node service, which runs the actual SQL and streams results back — bridging client dashboards to server databases.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:
