Host static HTML in Azure Web App Service - javascript

I'm azure beginner
I've created nodejs service and deployed it to Azure Web App service, it works as expected.
So, I have resource group mars-app and existing Web App service application my-mars-web-app.
Now, I want to add static HTML file, to show it when user goes to root URL https://***.azurewebsites.net/
To achieve it,
I have cloned github repo with client side to azure storage with azure cli help
In cliend code folder, I have tried to run az webapp up -g mars-app -n my-mars-web-app --html, but every time I'm receiving:
The webapp my-mars-web-app is a Linux app. The code detected at '/home/serhii/azure-website' will default to '<module 'os' from '/opt/az/lib/python3.6/os.py'>'. Please create a new app to continue this operation.
Because of above error, I have added index.html to dist diretory in my backend app
app.get('/', function (req, res) {
res.sendfile('dist/index.html');
});
and it works. But I'm not sure it is a good solution
What the best practice to add static HTML files to existing Web App service?
This question may be a dublicate of this question, but it was asked 5 years ago, so maybe something changed.
P.S. I know about Static Web Apps, but it is in preview and I'm interested in more generic solutions.
Thanks in advance
[UPDATE]
Here an article about deploying react app

Why you want to add static HTML files to existing web app services, for update or others?
In my opinon, now that you have used git, you can use continuous deployment.
When you modify your program (add new or modify files), in the Action of github, you will see the program start to deploy again. This should be the best deployment plan.

Related

What are the solutions for deploying Docker-based app in private production environment?

This is my first post on SO after a long time using it.
In advance, please apologize for my English ;)
Currently, I am working on an app that needs to be Dockerized. This app will be deployed on just one server in a private network. (We assume that the customer will not have access to the internet.)
To sum up, I build my app with a docker-compose.yml file. It consists of 2 nodejs app and a mongodb server.
What are my solutions to deploy this app in a private customer environment with only one server?
Thanks by advance.
finally, my research did great. I think I found a solution to my problem.
Because I'm using 2 node.js apps, and a MongoDB server, I will use PM2.
https://pm2.keymetrics.io
PM2 is a tool that will help to manage, monitor, restart in case of failures multiple node.js process.
I will just use this tool to make my project production ready (just npm and pm2 to install on the server) and talk about Docker for further investigations.
Thank you,

Running strapi project on hosting service provider

I don't understand how to run my Strapi project once it's online on the server. I have a website vpftravel.com and I want to fetch data from the Strapi collections (api) I created but the only way that Strapi runs is when I use the "start" command. I've read many times their deployment documentation but no luck. I also don't understand how I can access the Strapi dashboard once I've uploaded it to the hosting service's server.
Background on my project, it's just a regular JS, PHP and HTML site hosted on Aruba (hosting service). I've been using DatoCMS but I've surpassed the 10GB bandiwdth on their free tier hence why I'm looking into a locally hosted database.
Maybe Strapi is not the right tool for what I wanna do.
I'd appreciate any help.
This photo shows my personal project directory and I highlighted where the Strapi project is located inside the directory.
Strapi is not a "flat file" type of web app, it's adminUI is but the backend needs to run as a service. This is something you would use PM2 for (and I would not recommend using IIS)

Is there a way to deploy GSuite app in our own server and run on GSuite Market place? So that every one can use that

I Wanted to create GSuite app and deploy in my own server instead of deploying in google cloud. Is there a way to do it? It would be great if i get some solution for this.
Thanks in advance
You can't deploy G Suite apps/extensions to your own server - they must be published via Chrome Web Store and/or G Suite Marketplace.
What you can do when you publish your app, is to set it as private so that only users in your domain can see and install the app. See Step 4 on Create and publish custom Chrome apps & extensions page for more details. Obviously, the app must be published by a domain account - you don't get that option if you publish an app from your personal/Gmail account.

Angular 4 SEO Friendly solution in prod

I'm trying to create a website in Angular 4. It is a base of my personal study.
My website is up and running but I'm trying to improve it. I checked and apparently my website is not SEO Friendly. I make some changes and I discovered this sample https://oliverveits.wordpress.com/2017/07/05/server-side-rendering-in-angular-4-with-universal/ That show an Angular 4 app with Page Source code.
I make the changes, I started to use Webpack and other features sugared by in the link. When I run the command "npm run start" and I access http://localhost:8000 I can see the Page Source. But when I copy the dist to my server on Godaddy domain I can't.
I'm not sure about what I have to do. If I need put my website in a node.js server or if I'm not compiling it correctly to have what I'm expecting.
I'm open to different approachs.
Well, I found the what causes this issue.
I think many of new Angular devs possible have the same problem.
When you run "npm start" or "ng s" what are you doing is put the node to listen a specific port. In other words, you are running a node server.
In another approach, copy the files to an IIS server or Apache Server. This doesn't make the Node Server run. In this scenario, the pages are download to the client browser and run as HTML/javascript page. And because of this when I try to see the Page source I saw the Angular files.
Took me a while to understand it. My background is .Net development.
Now a day my website is running in one of the many node.js servers. evennode.com, on this server instead of to have an IIS or Apache, they set up a Node Server to listing a specific port and then you are able to run all your development on the server side.
I found easier use a node js server like evennode them set tup node js run on my Goddady account.

Ember app served from node.js using baseUrl/rootUrl with authentication

So, currently I have been using Ember cli to proxy to my api that is on a different port. I am trying to serve up a few routes using only node ('/', '/signIn', '/signUp'), and then once a user is authenticated through the '/signIn' route, serve up the ember app with a token.
As of now I am using 'baseURL' defined in my 'environment.js' of ember-cli, and my ember app is served to '/app/'.
I am getting confused on how one would go about serving up the ember app when a certain node route is accessed and the token is validated. In other words, I can visit my node routes fine, I can visit my ember routes fine using /app/, but am unsure of how to serve up the ember app once my server authenticates the user at '/signIn'. My reasoning for this, is that I do not want to serve up all the javascript assets to the client until I am sure they are an actual user. I am sure that this can be done using node and ember, but have not found much material online regarding such a configuration.
I have done a good amount of research, and the things that have caught my eye are 'baseURL' defined in CLI, 'rootURL' defined in Ember, and this from the Ember CLI page:
Integration
When using Ember inside another project, you may want to launch
Ember only when a specific route is accessed. If you’re preloading
the Ember javascript before you access the route,
you have to disable autoRun:
var app = new EmberApp({
autoRun: false
});
To manually run Ember: require("app-name/app")["default"].create({/* app settings */});
I know that people in production build the cli app into their '/dist' directory, and then server up the 'index' on their server, but I am not sure if this is the right path to go for development.
To recap, I have an ember-cli app that is getting proxied to my node server. I have a '/', '/signIn', and a '/signUp' route that is handled by node.js completely. I also have an ember app that is served at '/app/' and is making requests to my node app successfully.
What I am unsure of is how to server up the ember app once a user is verified at '/signUp' of my node server.
Any help at all is greatly appreciated. I am very new to this stuff, so please be gentle. I have researched this for two business days while consulting with senior engineers, and they have no clue about frameworks such as Ember.

Categories