Node Module "open" Is Not Opening URL
I am trying to open URL using node module OPEN, but it is not working. I have installed Open and i can see the open module in node module folder.
Below is my code.
const open = require('open'); open('https://myurl');
I am working on Microsoft bot framework. Deployed the code in AZURE. The same code is working in emulator but in browser it is not working.
Any help is appreciated.
Thanks Sanjeev Gautam
When building bots - or any web app really - it is important to consider that there are two sides: the server and the client. When you are connected to the Emulator you are running the bot locally, so the server is running locally. When you deployed the bot the server is running in Azure and no longer has access to the user's machine.
Looking at your code, you are calling
open('https://myurl') on the bot side or the server side - not the client side. When the bot is running locally, the server opens the web page on your machine so everything seems to work fine, but when it's running on Azure, it's trying to open the web page in Azure which isn't accessible to the user.
Unfortunately, you cannot control the behavior of the client from the server, so you will have to send a card with an open url action or send the link to the user to follow.
- → Maximum call stack exceeded when instantiating class inside of a module
- → Browserify api: how to pass advanced option to script
- → Node.js Passing object from server.js to external modules?
- → gulp-rename makes copies, but does not replace
- → requiring RX.js in node.js
- → Remove an ObjectId from an array of objectId
- → Can not connect to Redis
- → React: How to publish page on server using React-starter-kit
- → Express - better pattern for passing data between middleware functions
- → Can't get plotly + node.js to stream data coming through POST requests
- → IsGenerator implementation
- → Async/Await not waiting
- → (Socket.io on nodejs) Updating div with mysql data stops without showing error