How access Realm Mobile Platform from Node.js client? - javascript

I am running Realm Mobile Platform on Ubuntu Server 16.04.2 virtual machine and I am able to access the HTML admin panel and connect to the server using Realm OS X browser.
On the server, would be possible to install NPM realm package an connect to the local database as admin user?
I tried calling Realm.Sync.User.login from Node.js console, but I am get an error informing that Realm.Sync is not available at developer edition.

using the node.js Realm SDK with sync is limited to the professional edition. If you would like to use the node SDK with sync you can either get a free trial or install it on an OSX machine.

Related

"MongoError: pool destroyed" in NodeRED

We are having windows server on which linux VM is installed.
On windows server we have -
MongoDB 3.6.17 Community Edition /
Node.js v10.19.0
On Linux VM we have installed NodeRed container /
Node.js v16.17.1
As mongoDB and Nodered are in same subnet we are able to establish communication between them.
On linux VM we have installed Azure IoT Edge and Nodered container is running on the top of it.
I am fetching data from MongoDB into NodeRED and then processing it further.
This flow works absolutely fine, however in some cases I am getting this error - "MongoError: pool destroyed".
After this I am not able to fetch data from MongoDB.
Once I Open/Close debug node and deploy the flow it starts to work again.
I'm using:
node-red-node-mongodb (0.2.5)
Can anyone please suggest what might be the root cause for this problem?
Can the differences in Node.js versions in windows and linux create an issue?
Please refer image for your reference -

How connect to Html page with node.js server and aws virtual machine

I'm trying to install a node.js server for a sentiment analysis service with my Twitter account that retrieve the tweets on my profile and provides a statistical output and saves them on a Mongo db istance.
I have uploaded my node.js code on an AWS virtual machine with an public IP address and with the permission to create an endpoint with HTTP and HTTPS protocols.
I have installed successfully the node.js code on AWS virtual machine with Windows Server 2019 OS, with the npm install -g -n command with 0 dependencies errors, and when I try to connect to the AWS virtual machine with http://ip_public_address:8080 I get the error "impossible to connect - err-connection_timeout".
This is the link to the github project that I need to install and to work on AWS virtual machine:
https://github.com/thisandagain/sentiment
Maybe I am confused about how to connect with the index.html page via AWS virtual machine and I don't know if this page must be retrieved with a IP public address or localhost parameter and what is required, at node.js level code, in order to enable the AWS virtual machine to respond to my browser with the content of index.html page.
Please can you give me advices about to implement successfully this project?
Thanks
Filippo
You don't mention security groups in your question at all, so the likely cause is that you never opened port 8080 in the security group assigned to the EC2 instance. You may also need to open that port in the Windows firewall on that server.

Why can't I get my android emulator to connect to my local server?

I am developing an app using React Native and made my server with node.js. For websocket connections I use socket.io
The thing is if I install the app to my android device and my android emulator, only my android device can connect to my local server. They both run the same code. I checked and the emulator has an active internet connection. Weird thing is I have an other app inside the emulator that connects to the same server without any problems using the same connection methods.
Do you guys have any idea why there is a problem like this?
Android emulators have a built in IP to use when connecting to something on your local machine.
If the socket is running on localhost, you want to connect to using the IP address 10.0.2.2 in the emulator.

Install node.js at Shared Dreamhost

Im trying to install node.js to shared dreamhost. I have followed the directions for Dan dean here http://dandean.com/nodejs-on-dreamhost-shared-server/
but when I go test,
$ node --version
Then it says:
-bash: node: command not found
I follow the step by step, this is the correct way to install the node in the shared server?
Dreamhost has supported Node.js on shared host recently.
I put the following source code in app.js and it works.
var http = require('http');
var server = http.createServer(function(req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end("Hello World!\n");
});
server.listen(3000);
But it seems to be unstable when I try to restart it.
Check https://help.dreamhost.com/hc/en-us/articles/217185397-Node-js-overview for details.
You may want to look into nvm when installing Node somewhere else than your local environment.
Check out my blog post on nvm:
http://mycodesmells.com/post/node-version-management/
Sometimes, installing node.js on certain linux instances creates the command nodejs instead of node. Try nodejs --version. If you want to be able to use node as the command, simply create a simlink to /usr/local/bin/nodejs for /usr/local/bin/node.
Currently DreamHost says “Node.js can be installed onto Shared, VPS, and Dedicated Servers.” However, for shared servers, currently Node is only supported using Passenger, and the version of Passenger “running on DreamHost servers does not currently function with Node.js versions 14+” as of March 1, 2022. They have not shared a target date for allowing newer versions of Node.
For more instructions, and up-to-date compatibility information, see their support documentation on Node.js at Dreamhost.
It may not have been the case at the time this question was posted, but Dreamhost does not allow compiling or running nodejs on shared hosting.
Can Node.js be used on shared servers?
No. DreamHost does not support Node.js on shared web servers, as the security setup on DreamHost shared servers is incompatible with compiling or running Node.js.
Furthermore, Dreamhost claims they will ban users who attempt to do so:
If you try to compile Node.js on one of the shared web servers, your user will automatically be banned through grsec (taking down all the PHP websites that run under that user) and the server will have to be rebooted before your user can be unbanned. If you do it one more time, you will be forced to move to a VPS.
I've had Dreamhost shared hosting for nearly 10 years, but they don't allow long-running processes. This also prevents common tools like composer from running if they take more than a few seconds. I recently moved to a VPS because of this.
https://help.dreamhost.com/hc/en-us/articles/217185397-Node-js-overview

Bluetooth in Meteor?

I'm pretty new to Meteor and web development and such.
My essential question is: is there a 'right' way to communicate with a client's Bluetooth hardware in Meteor/js?
Currently, I'm thinking of writing a driver that takes the Bluetooth data and sends it in a stream to localhost, but that seems a little bit roundabout.
You would have to go via an npm module in Meteor. For this you need to make a package that uses something like bluetooth-serial-port to allow Meteor to communicate with the device using the host device's bluetooth serial port (https://npmjs.org/package/bluetooth-serial-port) (You will need the bluetooth development headers too)
Avital has made a package demonstrating how to use npm modules with meteor : https://github.com/avital/meteor-xml2js-npm-demo

Categories