I have developed a search engine app using express js and elastic search. Everything is working normally on localhost but when I deploy it on Heroku only express app gets deployed and elastic search client runs on localhost. So how can I deploy both of them together?
Simply speaking you will have to ssh into Heroku server and install an instance of elasticsearch there which is impossible if you're using free tier of Heroku. Other solution might be finding a cloud elasticsearch provider and update configs in your app to connect to it
Related
I am new in reactjs and nodejs.I made an application with react frontend and express backend. There are axios post and get requests for get data from mssql database via express.
When the project in production level, I write the IPv4 address and port for access dashboard from another device in local network. After build,when I use for example localhost:5000 for requests, I can see all datas which are come from database in the device which react project running but with this I cant see datas from android phone in local network.
What should I do? Isn't there any other way than writing a static IP address? This project can be run different machines.
I am sorry for my spelling mistakes.
I have a create-my-react bootstrapped application that is essentially a website that uses some FETCH API calls to a external API and it is deployed and works fine.
However, I added my own Nodejs backend, by creating a server and using using express for the routes/middleware. Everything works fine locally. I can hit my internal API endpoints (localhost:3000/myapiurlhere) and it performs an action on a database.
I have to run npm start to start up the create-my-react-app locally and then manually run the node server by node src/server.js then my internal API works.
The Azure Web App service is basically a preconfigured server with the Node RUNTIME on it, and it only seems to give you access to the D:\home\site\wwwroot folder (Windows server).
Do I need to find a way to run node server.js command on the server to start my node backend, or should it be running automatically? Also, I'm using create-my-react-app and npm run build , so it creates a build folder with a nested static folder.
I have started up REST APIs on Java on my Linux Ubuntu servers before but never on an App Service like Azure. How can I achieve what I'm trying to do?
Here is my server.js file:
const http = require('http');
const app = require('./app');
const port = process.env.PORT || 3001;
const server = http.createServer(app);
server.listen(port);
You dont have to do anything special, Have you followed this page on how to deploy basic nodejs app on Azure AppService?
One additional thing you need to do is that pass the Node version on appsettings of the appservice.
WEBSITE_NODE_DEFAULT_VERSION for the setting key.
I use zeit-now to deploy my website.
But I can't connect to my MySQL server.
I'm sure my MySQL server is able to be connected on my machine.
Here is my repo.
Any solution?
In the FAQ it says
Now itself focuses on being the best platform for serverless hosting. This means that the workloads we handle are static or stateless.
Still, you're trying to connect to your database on localhost. Although running a database instance in a docker container might be an option for a staging system, it definitely is not for production systems, since you will lose the data when you restart/redeploy. And you don't seem to startup a docker container in your deployment.
You should use a cloud database provider instead:
Use Cloud Databases that offer secure (preferably HTTPS-based) gateways, for example: Azure CosmosDB, MongoDB, Atlas, Firebase, Google Cloud SQL
I'm just beginning to use cloud foundry.
I ran this node js sample app of cloud foundry on predix (I just changed the app name in manifest.yml). The code is fine locally and can be pushed to the cloud using cf CLI. The app status in the console is started for both of them. But when I go to the URL, the site can't be reached. Please help.
Edit
The microservice template is not running locally.
In the cloud, make sure you're using the https:// protocol. This is required in Predix cloud.
Locally, what errors do you see?
How can I deploy my Meteor app on the address 192.168.1.21:25565? I've started an HTTP server on that address with pure Node.js, but I can't seem to get it to work the same with Meteor.
if 192.168.1.21 is the address of the machine hosting your code, then just start it up with
meteor --port 25565
if that's not your problem, check out this post,
How to run meteor server on a different ip address?