Local Rest API with NodeJS an SQLite


I installed NodeJS and used the following tutorial (https://github.com/romwaldtff/NodeJS-REST-API-SQLite) to set up a local REST API. It uses an SQLite Database which I filled with some demo data. It works fine with the REST node. The problem is, that it works only inside Noodl, but it doesn’t work inside a browser (http://localhost:8574/external/viewer/index.html) or on a mobile phone. Is this a bug or what am I missing? Please help me. If I got this running, everyone could build prototypes with simple access to a relational database (SQLite).

Details to my example:
Rest Node:
Endpoint: http://localhost:3000
Resrouce: /api/car
Method: GET
// The input ports of the REST node, name of input and type

// The output ports of the REST node, name of output and type

request:function(inputs,request) {

response:function(outputs,response) {
    var colors = response.content; 
    var color = colors[1];
    outputs.ExampleOutput = color.model;


Thanks for your help, Philipp


This is probably due to CORS problems. If you check the developer console, and it says something along the lines of “No Access Control Allow Origin Header on the requested resource”, it means you need to update your Node.js server to use CORS headers.

Basically, for security reasons, browsers refuse to connect to a server if the server doesn’t specifically allow browsers to do that through a few special headers. Noodl is a native app and therefore works fine, but a browser will refuse to connect.

Fortunately it’s an easy fix. Add this middleware to your express server and it should work: https://github.com/expressjs/cors. Follow the Simple Usage (Enable All CORS Requests) example, no need for any additional configuration.

Hope that helps!


Hello micart, it works. Thank you very much :slight_smile: