one cloud server and running multiple node and mongo project - node.js

I bought a cloud server from digitalocean. I have a problem
I wrote a project that using node js web services and mongodb database I'm trying to setup node js and mongo db its okay but my problem is how can I deploy my node js app which will use mongodb and using my custom domain.
Now my domain at natro.com I can't complex with all of them any tutorial that you have known or something else can be helpful?
I don't know much about server management.
My server can be ubuntu or debian, doesn't matter, depends on tutorial or some blog post.

First step is add your domain in Network area of DigitalOcean Panel. Use this tutorial.
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-host-name-with-digitalocean
Now, follow this tutorial for deploying your nodejs app with nginx
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04

Related

How to connect Meteor Js application with mongoDB

I start work on fresh application of MeteorJs and facing problem with mongoDB connection with application and have research a lot regarding this but not get any proper solution.
I need to connect my MeteorJs Application with MongoDB and research about this issue but didn't get any solution.
If you are using Meteor Cloud then you should stick to the official docs: https://galaxy-guide.meteor.com/mongodb.html#authentication
If you are using Meteor-Up (MUP) then you should check out the Mongo configuration: https://meteor-up.com/docs.html#mongodb
If you want to connect to a MongoDb with a custom deployment or your local development setup then you need to properly configure the MONGO_URL: https://docs.meteor.com/environment-variables.html#MONGO-URL
Don't forget to configure MONGO_OPLOG_URL as well: https://docs.meteor.com/environment-variables.html#MONGO-OPLOG-URL

Hosting Nodejs Mongodb website with frontend but not React

I'm very new in MERN stack development, I made a blog website with backend used HTML CSS JS NODEJS & MONGODB. and I want to host in netlify and heroku.
Tried So many times but got error.
My Github repo link :
here
Can any one completely explain how to host ?
If you're just getting started with hosting your apps, try a newer generation app hosting platform where you just connect your GitHub repo and it does everything else for you.
Node.js and Mongo is perfect for Adaptable.io. The free tier includes a Mongo database. Here's the guide to deploying a Node.js App with MongoDB. You could also try Render but they don't have MongoDB.

How to deploy vue cli project to aws lightsail

I am a beginner at deploying web apps, however I have some experience developing them. I just finished a project I amde using node, express, and vue. I am trying to deploy it to AWS Lightsail. So far what I have done is create a nodejs instance and a MySQL database on lightsail. I have a backend folder connects to the database as well as some API's that are used in the front end. I also have a front end folder which contains the entire vue project. How shold I go about deploying this to lightsail? Are there any good references or videos I could use? I tried following the AWS documentation but it wasnt very helpful. Any help would be appreciated.

how to deploy an ionic-react app to mobile if I'm using node js server in the backend?

I discovered ionic this week and I'm really considering using it at work.
Basically, my goal is to build an app that will work on android and Ios, where the needed functionality is to connect to the cloud over web socket and pull data from the cloud and show it on my phone. Maybe later I'll eventually need to consider using login but not for now at least.
Normally, if I'm building a web app. I ll use nodejs to pull the data from the cloud and expose it to the frontend. I ll write all code together and I ll host my app in Heroku or something where the entry point is my nodejs server right? So that my server needs to start and it will take care of the rest.
This is a bit confusing in ionic since I need to start the app with ionic serve, but somehow I also need to start my nodejs server too right? So I assume I can't write the server-side code inside the ionic app or am I wrong?
There is not much about this on the internet but I did some research and I guess that I should deploy (host) my nodejs server in the cloud (maybe using Heroku) and then connect to the server from my mobile app over the socket. Is this the right/only way to do this? are there any security issues with this method?
I find ionic great but I'm not sure if I should use it at work. Sincerely, this use case of using a backend server with ionic made me confused.
Ionic looks ideal for building cross-platform apps that does not need server-side scripting, but how complex can it be if I want to integrate some server-side code in my app? especially as I said I'm going to use some login forms in the future to extend the functionality of my app.
PS: I'm using ionic 6.10.1 and specifically I'm interested in using ionic with react not with angular.
After some search, I discovered that it isn't possible to deploy the frontend and backend code together. Therefore the trick is to deploy the nodejs server separate from the frontend.
Precisely, if it is a web app, then you should deploy the nodejs server in a separate host from the frontend. Then by starting the frontend app, you can communicate with the running nodejs server via socket or REST API.
Hope this helps someone in the future :)

how to deploy nodejs rest api with express framework on production server windows

I have created a node.js rest api created using express framework for routing. I have used tutorial
Now I want to deploy that rest api on actual production server. How to achieve that thing.
I have gone through below links.
Deploy node js application with express framework on production mode --- Only for linux. I need for windows.
Deploying NodeJs Express Rest API to Windows 10 IoT -- a little bit similar problem but no solution
https://stackoverflow.com/a/38652869/2810015 -- this said to run npm start on production server after copying all of the files on server. But this is not working fine either.
Any help will be highly useful.
You use pm2?
Usually I use it to start the application. It works for both windows and linux. He leaves the service initated, and in case something happens that knocks the service up again.
You install it on the server, and instead of using it
node server.js
You use the command below
pm2 server.js start
Link: http://pm2.keymetrics.io/docs/advanced/pm2-module-system/

Resources