Last few weeks I had been trying to connect oracle db from my nodejs code. What I found so far are 2 main libraries such as https://github.com/mariano/node-db-oracle which i
I know this is an old post... just wanted to mention a sure way for nodejs to communicate to oracle without extra modules.
Set up oracle so it can create and receive http requests. There are a few ways to do this:
The easiest is to turn on the epg gateway:
Also you can setup modplsq:
or the Apex listener:
Then in node js do a standard http.get:
http.get("http://localhost/accessor/myschema.my_procedure?x=1&y=2", function(res) {
console.log("Got response: " + res.statusCode);
}).on('error', function(e) {
console.log("Got error: " + e.message);
});
Whichever approach...secure oracle so that it will only respond to the ip address of the nodejs server. So if running on localhost:
if owa_util.get_cgi_env('REMOTE_ADDR') = '127.0.0.1' then
--ok
else
-- fail
end if;
Also block calls to every other package and procedure. There are few ways to do this depending on the path you take.
Make sure you do this at a minimum:
There you have it...no need to worry if a module will break or stop working with the next release.
AND...you can easily communicate from Oracle to Node use: