Express and EJS rendering weird behaviour


I’m making my app using electron as main framework, express.js as middleware and ejs as rendering engine.
i’ve several calls on express and everything works fine, except for one, which display correct result if i call it from browser like http://localhost:3000/messages/123/1 (123 is the id, and 1 is the channel).
The browser displays all the results (from a sqlite query) correctly in regular browser, but doesn’t display anything in electron app.
this is the code

   //restapi is an instance of express.js
   restapi.get("/messaggi/:id/:canale", (req, res) => {
//maindb is a working instance of sqlite database
//q is a working query like "SELECT * FROM MESSAGES"
    maindb.all(q,function (err,allrows) {
    console.log("MESSAGES ",allrows);
     data: allrows,
     path: app.getPath('documents'),
     whut:"ID: "+id+" CANALE:"+canale+" ERR: "+err+" L:"+allrows.length



i’ve been trying with res.render using an EJS file, and as above, a JSON rendering.
in my log, i can see the result of the query, also in a web browser (i’m using chrome), and i can see and print all the other vars that i’m sending, like “path” or “whut” (used only for testing)

what am i doing wrong?!