drechema / iris-nodejs

Demo API using node.js able to receive HTTP GET, POST and DELETE of custom JSON objects in InterSystems IRIS
MIT License
1 stars 0 forks source link

Trying on windows, cannot start #3

Open davidpeterunderhill opened 4 years ago

davidpeterunderhill commented 4 years ago

I have extracted onto my windows IRIS installation, run npm install, copied a valid iris.node into ./node_modules/iris, and amended ./config/config.js (this needs documenting?) but I get an error when using npm start `C:\InterSystems\IRIS\mgr\restore\iris-nodejs-master>npm start

iris-nodejs-demo@1.0.0 start C:\InterSystems\IRIS\mgr\restore\iris-nodejs-master node server.js Express web server started! { ErrorMessage: Connection was broken by the server. Check arguments for validity., ErrorCode: 1009, ok: 0 }`

I can't see anything wrong in the config, any ideas?

davidpeterunderhill commented 4 years ago

Found the IRIS connection details are also in ./test/test.js so amended these as well but still the same issue.

davidpeterunderhill commented 4 years ago

Found the issue, could be an iris node mudule update change but the parameter named used for irisConfig in ./config/config.js are wrong.

Original values: const irisConfig = { ip_address: '127.0.0.1', tcp_port: 51773, username: '_SYSTEM', password: 'SYS', namespace: 'restore' };

Correct values: const irisConfig = { host: '127.0.0.1', port: 51773, user: '_SYSTEM', pwd: 'SYS', ns: 'restore' };

davidpeterunderhill commented 4 years ago

Spoke too soon, the initial error has gone but get the below when accessing the test url

Error: IRIS database not open at C:\InterSystems\IRIS\mgr\restore\iris-nodejs-master\routes\test.js:44:8 at Layer.handle [as handle_request] (C:\InterSystems\IRIS\mgr\restore\iris-nodejs-master\node_modules\express\lib\router\layer.js:95:5) at next (C:\InterSystems\IRIS\mgr\restore\iris-nodejs-master\node_modules\express\lib\router\route.js:137:13) at Route.dispatch (C:\InterSystems\IRIS\mgr\restore\iris-nodejs-master\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (C:\InterSystems\IRIS\mgr\restore\iris-nodejs-master\node_modules\express\lib\router\layer.js:95:5) at C:\InterSystems\IRIS\mgr\restore\iris-nodejs-master\node_modules\express\lib\router\index.js:281:22 at Function.process_params (C:\InterSystems\IRIS\mgr\restore\iris-nodejs-master\node_modules\express\lib\router\index.js:335:12) at next (C:\InterSystems\IRIS\mgr\restore\iris-nodejs-master\node_modules\express\lib\router\index.js:275:10) at Function.handle (C:\InterSystems\IRIS\mgr\restore\iris-nodejs-master\node_modules\express\lib\router\index.js:174:3) at router (C:\InterSystems\IRIS\mgr\restore\iris-nodejs-master\node_modules\express\lib\router\index.js:47:12)

davidpeterunderhill commented 4 years ago

Ok, finally got this working, despite there being very little useful or up to date documentation from Intersystems I found an example in the qewd project to base the config on. It seems the new iris.node does not use tcp so the correct config which I have tested is working is const irisConfig = { path: 'c:\\Intersystems\\IRIS\\mgr\\', username: '_SYSTEM', password: 'SYS', namespace: 'RESTORE' };