Electron Server-side for datatables

i'm developing an app with Electron that must work on/offline i'm even using a sqlite database (with sql.js) the data retrieved from the database (500k rows more or less) are rendered in a datatable (using datatables.net) Reading around, for huge amount of data, they suggest to use a server-side query, but working with electron seems to be hard to simulate server-side requests.

What i'd like to do is sending my query string to a js file (that works like a server handler) and returns me the JSON to populate via Ajax the datatable.

Any idea?!