Running Mongodb CRUD API on azure (for Ionic) - node.js

I'm trying to run a MongoDB (using NodeJS and Express) on the Azure Server as a server side part of my ionic app.
Once placed on Azure I'd like to access it with my Ionic App using CRUD operations.
What steps do I go through after acquiring a Azure Portal account? Do I take Mobile Services or a simple Web Api?
Is there something specific that I need to add to the NodeJS server?

Generally, the app using Node and MongoDB as the backend for mobile client hosted on Azure App Service, such as WebApps, Mobile Apps (recommended).
Based on my understanding, I think there are some documents that may be helpful for you, please see them below.
For Web Apps, you can refer to the tutorial Get started with Node.js web apps in Azure App Service.
For Mobile Apps, I think your ionic app was based on cordova, there is a tutorial for getting started with cordova Create an Apache Cordova app. And Two related blogs shown a sample of Node + MongoDB on Azure for mobile, please see below.
Exposing MongoDB collections on the node.js backend
Querying MongoDB collections via the Azure Mobile Service node.js backend
To deploy the app to Azure App Service, you can try to publish it via FTP, git, or IDE like VS, please see https://azure.microsoft.com/en-us/documentation/articles/web-sites-deploy/.
Hope it helps. Any concern, please feel free to let me know.

Related

Need some guidance on deploying/hosting a web app

I recently developed a web app locally, with a React frontend that interacts via proxy with a Node.js backend that interacts with MongoDB Atlas. Everything works locally, and I am ready to actually deploy the web app for public use.
How does hosting work with a full stack web application? Do I host the entire web app in the same place (e.g. S3 bucket), or should the backend and frontend be deployed separately? I have never done this before, so I appreciate any help I can get.
Yes, you can have two different servers for frontend and backend.
You can use theHeroku platform to deploy your backend app, and Mlab to provision a Mongo database. These platforms has free tiers where you can experiment and learn about deployments and clouds.
Once you are comfortable with these then you can move to Elastic Bean Stalk on AWS to provision servers and also database.
Now mlab is not available as it is already been acquired by mongoDB only, so I would recommend you to create the database on Atlas cluster which also offers a free tier.
Rather than using the Heroku, I would suggest you to use MongoDB stitch which is also the backend as a service. If you will use stitch then you can also seek for support from mongoDB people but in case you will use heroku then you will not receive any support from them.
You can refer to the documentation of stitch for more information https://docs.mongodb.com/stitch/. This has complete guidance how you can deploy your app using stich and can use mongodb database.
However if you need more help, please ping me anytime.

Azure : Deploy Angular(Front-End) & Node (Back-End) app without VM

I am new to Azure. I have never used azure. So don't mind if this is some silly question.
I have a client who also doesn't know much about deploying.
I have angular/node apps. He wants to host on Azure WITHOUT using a VM.
I am not sure about azure. So i don't know how to deploy without VM.
I know to deploy with RDP(Remote Desktop).
Can anyone help me with this. Is there a way to deploy angular & node app without VM?
Is there any specific documentation for it? Which services will i need in Azure?
Thanks in advance!
Except Azure VM, there are normally two ways to deploy Node.js app on Azure which include App Service - Web Apps and Web Apps for Containers, please see the links below to know these guides.
For deploying Node.js app on Azure Web Apps.
Create a Node.js web app in Azure
Tutorial: Build a Node.js and MongoDB web app in Azure
To deploy the app with a ZIP file, or via FTP, cloud sync, or deploy continuously, or from local Git, etc. You can see more at the left sidebar of these pages.
For deploying Node.js app on Azure Web App for Containers, it's a simple way to deploy the app on Azure as similiar as on local docker.
Create a Node.js web app in Azure App Service on Linux
Build a Node.js and MongoDB web app in Azure App Service on Linux
To deploy via FTP, cloud sync, or deploy continuously, or from local git, etc. Also, you can see more at the left sidebar of these pages.
Some important tools will help deploying easier.
Deploy via VSCode, you can refer to these offical documents for WebApp(App Services) or Container(Docker Images).
To deploy on WebApp not Container, Kudu is a common tool for debuging and deployment. Meanwhile, for Node.js app, we need to use iisnode to connect IIS as revese proxy for your app, and configure the web.config file via follow the kudu wiki document. The Kudu wiki is very useful and valuable for new to Azure.
There are more details for this topic which can not be listed one by one at here, but the above these are necessary. The offical guide for Javascript developers is helpful for new to Azure.
Jay Gong posted a great answer for hosting on Azure. However, you might want to ask your client if s/he means s/he wants a micro services architecture. For more information on micro services, check out this link.
The other viable option would be an App Service (which is an Azure service that manages deployment and abstracts a lot away, but there's a VM under the hood)? Without a VM for hosting, it would be rather difficult to do anything in the cloud on Azure - the only other option is local hosting, which would be without Azure. I would argue that it ruins the purpose of using cloud services, as it seems your client is confused.

Start hybrid development with Heroku

I finished a website with Rails, Heroku & Salesforce and now i must create the same but as mobile application.
In the website project, Heroku was usefull to access Salesforce data with Heroku Connect and Heroku Postgress. I want to know if it's possible to use them for a mobile app.
I guess no, i did not fount lot of documentation about it and it's focus on iOs. I want to create hybrid app on Ionic
Is it possible do to it ?
Or a second idea is to create a REST API in Node as they suggest here to send Json to a connected mobile app dev with Ionic cordova. Another way to create an app connected to the Salesforce Data
I tried Salesforce MobileSDK but I always encouter issues.
What do you think is the best solution ?
if you have some ideas do not hesitate. I'm still "in the sandbox"
Yes, you can expose your Rails app as REST endpoints that your custom / Ionic mobile app can talk to. However, if you just want a mobile UI for the Salesforce parts then you can use Salesforce1 or the MobileSDK for custom mobile apps that just use Salesforce.

MongoDB on Azure Web APP

I'm running nodejs application via Azure Web App. How do I set up MongoDB on Web App service?
You need to provision MongoDB yourself and have your Web App work against it.
Azure doesn't have a native MongoDB service but you can:
Use Azure's DocumentDB with the Mongo driver compatibility
Use the MongoDB VM image from the marketplace (this is IaaS).
Use mLab which is a 3rd party hosted solution but can be bought from Azure

Is it possible to run a NodeJS app using phonegap?

I have a web app that is hosted on a web server that was created using NodeJS (http://www.ruffle.us). What I want to do is make this web app into a mobile application gaining access to the contact list to enter phone numbers. I have looked at technologies such as phonegap/cordova for this task but am still unsure from the documentation. Any experience or input on this would be appreciated.
Cordova provides a browser environment, so you can't run Node.js in it. But you can of course run your web frontend inside Cordova and use it to get access to device APIs like the contact list and communicate with your server.

Resources