Angular deploy to azure failed - javascript

I have angular app that I need to deploy to Azure
I deploy it via VS Code Azure App Service extension
App Service is Node LTS 10 and here is config for it
Here is startup command
pm2 serve /home/site/wwwroot --no-daemon --spa
After deploy vscode output says this
11:02:21 AM meetmymonsterreserve: Deployment successful.
11:02:30 AM: Deployment to "meetmymonsterreserve" completed.
But when I go to https://meetmymonsterreserve.azurewebsites.net/
I got this in console
At local project works well
Where can be a problem?

Related

How to host a Node.js app on AWS EC2 Ubuntu free tier?

I am really new to AWS EC2. I hosted my Express.js on AWS EC2 using PM2.
Here is the current log of EC2 of my app.
I don't know whether this is working or not.
My public IPv4 address is (52.90.33.231).
If Nginx is required, please guide me through its steps because I have no prior experience.
I am also adding the inbound rules here.
http://localhost:5002/questapi
The above url used to give me the following data:
So
52.90.33.231/questapi is the working url.
I would prefer using Docker to run your application in EC2 instead of using PM2, It will be easy for you to migrate your application to any environment irrespective of application dependencies. PM2 is a good deployment tool but the better answer will be DOCKER.
Regarding NGINX, You can use NGINX or APACHE web servers to enable reverse proxy on your Node services to route your 5002 port to 443/80. There also I would suggest using AWS Application load balancer because it will provide the same and easy for you to install SSL certificate using AWS CERTIFICATE MANAGER.
Steps to Docker Node deployment in Ec2
Install DOCKER in your EC2 machine - Follow this reference URL
Clone your NodeJS codebase in the EC2 machine and add Dockerfile in the root folder in your codebase. Below I will add the Dockerfile sample.
Build docker image using this command in your root folder of the project docker build --no-cache -t <your_application_name>:latest .
Run NodeJs docker image using the given command
sudo docker run --name <your_application_name> -itd --net="host"
-e 5002:5002
--restart unless-stopped
<your_application_name>:latest;
Now you can start using the application on <your_instance_public_ip>:5002, Make sure to enable the 5002 port in security group inbound access.
In between, Here I'm adding a reference link to use Aws ALB to hide your EC2 IP address and application port number by using reverse proxying rules.
https://www.clickittech.com/devops/deploy-nodejs-app-to-aws/
DOCKERFILE Sample for NODEJS application
FROM node:14.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm#5+)
COPY package.json /usr/src/app/
RUN npm install
# Bundle app source
COPY . .
EXPOSE 5002
CMD [ "node", "server.js" ] # you can add your start command
you should refer to this video (from Brad Traversy) where he deploys the Nodejs application on DigitalOcean droplet using pm2, but for deploying on AWS EC2 you can follow the exact same steps as both use the Ubuntu OS, NGINX and pm2 for configuring the application.
NODEJS DEPLOYING TUTORIAL

Javascript Single Page App - Azure Deployment VS code

https://learn.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-javascript-auth-code
I've followed this the tutorial linked above sucessfully, running it locally.
I can't figure out how to deploy into an App Service so I can host it in the cloud.
I would like deploy it through VS code and have installed the App Service extension.
Help?
You can login to your account and then deploy the Appservice as mentioned here
From the command palette (Ctrl+Shift+P), type "create web" and select Azure App Service: Create New Web
Create a resource group
Deploy to Appservice

Why am I getting an error when trying to run a new react native project

I have created a new react native project by running "react-native init MyFirstProject". I have also installed node and have added no code of my own to any of the files.
I have tried to run the project to make sure it works by running "react-native run-ios --simulator="iPhone 8"". The command runs successfully but I am given the following error.
Could not connect to development server.
Ensure the following:
Node server is running and available on the same network - run 'npm start' from react-native root
Node server URL is correctly set in AppDelegate
WiFi is enabled and connected to the same network as the Node Server
URL: http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false
RCTFatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
__CFRunLoopRun
CFRunLoopRunSpecific
Blockquote
GSEventRunModal
UIApplicationMain
main
start
How do I fix this error?
Try opening your project ios/MyFirstProject/MyFirstProject.xcworkspace and see if there's any build error.
I ran into this problem too, with the same error:
RCTFatal __28-[RCTCxxBridge handleError:]_block_invoke
It turned out that I had another server running on my local machine on the same port that the expo development client server was running (:8081), and that it was taking priority and then obviously giving the client a very different response to what it was expecting. Quitting the other server fixed the problem.

Issue deploying app to Heroku from cloud 9

I have an app on cloud 9 IDE, it works perfectly on cloud 9 when I run nodemon server.js but when I deploy it to Heroku it gives an application error.
How I am deploying it to git:
Login into Heroku and create an app online
Then in cloud 9 terminal I type heroku login and then type in my details
Then I type git init
Then heroku git:remote -a agile-stream-37163
Then git add .
Then git commit -am "initial commit"
Then git push heroku master
It deploys successfully but when I actually go to the app url it comes up with application error. I think I am deploying it wrong, I don't have much experience with git.
Heres an image from my cloud 9 terminal:
Can anyone please tell me how I can fix this.

Teamcity build, deploy and run nodejs application

I have a remote host on an ovh server that I can access with FTP and SSH.
I have a nodeJs backend that runs on this remote server.
I want to build, deploy and run this nodejs server on the remote host from TeamCity.
Actually, I can build the project with TeamCity and it works well, build passing or failing if I have wrong confirations.
Question :
How can I deploy and run my nodejs server , after the building steps, directly within teamcity ?
Thanks for advance
You can create a teamcity remote agent on the target host that you can use to deploy the built code.
you can create a teamcity target that will ssh to the target host and deploy your artefacts generated in the build.
You can get the artefacts from build -> deploy either through teamcity artefacts or through mounted disk volumes(nfs disks)

Categories

Resources