Uploading PERN stack on AZURE - node.js

I have made a basic todo list React app (PERN stack), and can run it locally on my computer. I have not added any files (docker or web config) aside from a client folder and server(frontend) folder(backend) following this tutorial
Youtube: https://www.youtube.com/watch?v=ldYcgPKEZC8
Github code: https://github.com/ousecTic/pern-todo-app
I am now uploading this application onto an Azure Web app, via a GitHub repository linked onto VS code. Deployment goes fine, but the site does not run properly.
Here are the errors I am receiving from Azure's end
enter image description here
enter image description here
What node modules or other things could I be missing?
Thanks

The issue to my problem turned out to be that I was uploading my front end and back end at the same time, only uploading my front end worked. Also found in my case that deploying directly is more reliable than deploying via a connection on Github.

Related

deploying nodejs and mongoDB to azure

I have a nodejs/express application and an atlas mongoDB set up. I can get the data from the database to my app if it is running on local host. When I try and deploy the app as a web app through Azure, it does not work; I click the button to get/display the data but nothing happens. What is causing this issue and how do I fix it?
I figured out what was wrong. My repository did not include a web.config file at all. Having never worked with web applications or Node before, I did not know this was needed. Once I added the file and put the proper path in, the code began working as intended. I can update this post with actual code if someone wants it.

TiddlyServer on Azure App Services not saving tiddlers and not uploading files

Inspired by the Tutorial for Running Node.js TW5 on Microsoft Azure for Free I'd like to host TiddlyServer on Azure. As a first attempt I followed the instructions in the tutorial and was successful in getting Node.js TW5 working on Azure.
I deployed TiddlyServer on my desktop without any difficulty.
Then I did the following to get TiddlyServer running on Azure, but got stuck. What am I doing wrong?
I downloaded tiddlyserver-2.2.0-alpha-3.zip and tiddlywiki-production-5.1.22.zip from TiddlyServer's Github and placed the tiddlyserver files in the wwwroot, and the tiddlywiki-production files in the tiddlywiki folder. I also created a data folder and I moved my tiddlers there.
I edited the package.json adding "scripts" to the end:
I edited the settings.json with client keys, _datafoldertarget and bindInfo
I deployed to Azure
I navigated to the web page and logged in following the TiddlyServer authentication dialogue
I opened my TiddlyWiki and got the following errors, and found this in the log:
As another test, I tried uploading a file using TiddlyServer's upload functionality but was not successful.

Live Heroku App has all broken images except background image (React/Node.js)

When the site is live every image except the background images hard coded in CSS come up as broken.
I build the app from the master branch on Github. On the repository all images load fine and extensions are not broken/different to the background image. The background image is in the same directory as the others and worked when I hosted on Netlify absolutely fine.
On console the images come up with a 404 error.
Any ideas?
Live site: https://deathless-studio.herokuapp.com/#/
Repository that images are in: https://github.com/matthew-devonport/DEATHLESS-Portfolio/tree/master/server/public/Images
Thank you!
Your web client is calling the images via
https://deathless-studio.herokuapp.com/IMAGES/Shop-Pics-Logo.jpg
instead of
https://deathless-studio.herokuapp.com/Images/Shop-Pics-Logo.jpg
(Try out the links. As you can see the images are there. Just the specified path was incorrect.)
If you do F12 or ctrl+shift+i and open the network tab you see the failing API calls:
And this is your git repository:
It is not possible with only Heroku. Because The Heroku filesystem is ephemeral
https://help.heroku.com/K1PPS2WM/why-are-my-file-uploads-missing-deleted
You can use
S3 File Upload https://devcenter.heroku.com/articles/s3-upload-node
Clodinary add-ons https://elements.heroku.com/addons/cloudinary
Good Luck :)

Nodejs app deployed to azure Webapp not working

I have deployed a Nodejs app (that is working on my local) to Azure Web app, however, I always a message in the browser as "You do not have permission to view this directory or page.". Is there any way I can debug it and find the cause of the this message or is it because of the some common issue in case any one has faced this before ?
There are several post around this issue. Here is something which you can try:
When you deploy the zip file, open KUDU or application editor from Azuer web app, which you can find it here:
Sometime if it is under your custom folder , you might get this issue.
Additionally please refer the below link for further troubleshooting
https://social.msdn.microsoft.com/Forums/azure/en-US/512e2eca-a2f2-4b32-a934-1081bddcdc86/nodejsweb-apps-azure-quotyou-do-not-have-permission-to-view-this-directory-or-pagequot?forum=opensourcedevwithazure
https://github.com/Azure-Samples/nodejs-docs-hello-world/issues/9
Also check this post for configuration:
https://github.com/projectkudu/kudu/wiki/Using-a-custom-web.config-for-Node-apps
Hope it helps.

Build Error while deploying to App Engine using custom containers

I am using a nodejs based custom deployment on App Engine using google/nodejs-runtime docker image.
I built my code on the localhost via
gcloud preview app run .
and it runs fine. But when i deploy it to my App Engine using
gcloud preview app deploy .
it give this error (along with whole stacktrace):
Build Error: Get https://index.docker.io/v1/repositories/google/nodejs-runtime/images: dial tcp: lookup index.docker.io on 192.168.2.1:53: no answer from server.
This seems to be error while fetching the repository from the internal google repos. Is it?
If yes, why is this and how can i make sure that this doesn't happen
again.
If no, then what is it and how do i solve it?
So this is what happens while deploying to the app engine:
Docker check for Google's repo for the image, as the image file i am using (google/nodejs-runtime) is by google and hosted on Google as well (i guess).
Check for any updates to the docker image and update the image file, this is necessary to always push updated versions to the deployment.
Pull changes and push the image to App Engine server and check if the app is serving.
While my assumption was that the issue was in docker registry on Google's end, it was not so.
So there were actually two issues which were causing the issue:
Primary issue (as mentioned in question's comments by #John-Lowry):
It was of the error was DNS name resolution to connect to the docker servers. This was due to my ISP's DNS issue which was blocking access to the servers. Resolved when changed ISP and also resolved after some time on the ISP #1.
Secondary issue (Not sure if exactly related):
Once i switched ISP the following error occurred
google.appengine.tools.docker.containers.ImageError: Image with tag google/docker-registry was not found
This was resolved once i updated the image from the server. Similar Question And finally the updated app was pushed to the servers.
I am not sure why the error occurred, but this is what i assessed:
The docker registry image (google/docker-registry) was updated at some point before the deployment. While deployment, the checks were performed for the image in use (google/nodejs-runtime) but since nodejs-runtime is dependent on docker-registry (i am guessing for maintaining various access policies), it was necessary to update to the newer image.
Please suggest edits.

Resources