Deploy a nodejs project in Microsoft Azure containing backend only - node.js

I am developing a angular project with node js as backend. In the backend microservices are used. Frontend and backend are seperate projects. I am trying to deploy both in azure. I was able to deploy the front end properly. I tried to deploy the backend too. But it was not successful. Does anyone know how to deploy a node js project with backend only in azure ?
UPDATE:
The thing is that I don't have a dist folder to build the node project. It just contains a server with microservices. What we do is we will use npm start to run it. When I try to hit the backend from the frontend, I get an saying that "You don't have the permission to view the directory or page".

Related

How to deploy Node.js & Express.js Backend to be used by Next.js Frontend via Vercel?

ho guys, i want to deploy my next.js application to vercel. well there's no problem about that. But for the reason of a scalable application i have my used backend written separately in Node.js. I also want this to be used with the Next.js Frontend preferably by hosting it on vercel.
So is this possible by default? I don't understand how to achieve this and what will be the necessary steps after having the backend, say, deployed on vercel.
Can you elaborate?
unfortunately you cannot host a backend on Vercel. If you want to host a backend simply you should look at Heroku or Railway. You should then be able to connect your Vercel frontend to your backend hosted by Heroku or Railway

React.js: How to create Google Authentication with separate Frontend and backend folders

I'm currently building a project in React.js (Node.js + Firebase) where I have my frontend and backend folders separately. Both front and backend folders are located in the root map named "Fullstackproject", and each has a package.json.
As I have installed firebase-admin to my backend project. I have already created a database that is working fine!
Now I'm trying to implement Google authentication by creating a Login page in the frontend project, but it seems like I'm not able to import Firebase settings such as (import {sign} from 'firebase/auth') because my frontend doesn't have the Firebase package installed
Do I have to install firebase to my frontend project as well?

Azure AppService - How to connect and deploy front and back

I'm absolutely new to Azure, CI, and CD.
I have an app consisting of a frontend developed under React + Typescript which sends CRUD requests to a typescript backend. Both front and end are NPM projects.
I've no idea on how to step from development environment to production, deploying to Azure.
Should I create two separate AppServices, one for each project?
If that's the case, how do I then connect them?
Do I just need to change the URL the server listens to?
As you can see I've no idea of what I'm doing but I'm eager to learn so any feedback is much appreciated
The most common approach is
Deploy frontend app ( react ) in one app service.
Backend nodejs app on a different app service.
Then, call the api of the nodejs app from the frontend.
Or,
Set up and run the client and server on the same server using a gulp file and deploy that project on an app service. In that case, there is no cross-site communication. This is the most preferred one.
Using the same app service for both front end and back end application. Refer nodeexpress-backend-with-angular-front-end-in-a-single-azure-web-app.
Using Cors to connect front end and backend Check here
Refer SO Link 1 & Link 2
And You can use deploy staging slots in app service to use different environment like (test/dev, Production).

Can I only deploy the server side of my react native app to Heroku?

I have a react native app that I'm building using expo. For the backend, I am using node.js and Express.
My app hierarchy is such that I have a frontend folder and a backend (server) folder. For example,
Root
|
|Frontend
|Various screens & associated files
|Server
|Routes & other files
For my project, is it possible to just host the backend and not the rest of the app? Such that when I fetch data in the frontend using HTTP requests, instead of routing through localhost (http: //RandomIP:PORT/route) I would use the heroku address as the routing address. I would also host the SQL database along with it.
I tried to follow along with the Heroku documentation, but it seemed like that was for hosting the entirety of the app / web apps instead of mobile, and I ran into constant errors.
I would like to point out that, unlike web pages, mobile apps cannot be hosted on the server and fetched on-demand. In other words, do not try to upload your react-native code to Heroku instead just upload your backend only and then make HTTP requests through the URL provided by Heroku after you have deployed your code.
Therefore go into your backend codebase, initialize a git repository and just deploy that Heroku. Also, you will need to host your SQL database on another service such as Google's Cloud SQL or Amazons AWS Database Services.

How to deploy socket.io and React app to Azure?

I'm a total newbie to web development, so please guide me.
I've successfully finished a socket.io and reactjs website locally using tools like webpack and babel. There's one Nodejs server file(also has socket.io) and remaining all are client-side files.
I want to deploy this app to Azure using Azure App Services.
How can I achieve this?
Thanks!
You can try going through Create a Node.js chat application with Socket.IO in Azure App Service. For webpack application, you can check out my earlier post on SO.

Resources