简体   繁体   中英

Site is deployed on Azure, but I cannot get access index.html

I am trying to build and release front-end app based on quasar on Azure Portal.

Building is OK.

Releasing is OK, but when I go to the apps link I see standard welcome screen:

在此处输入图像描述

I checked deployed code via SSH it is there, but it is located on "/home/site/wwwroot/index.html"

在此处输入图像描述

How do I point to the correct folder with my app? Thank you!

Firstly there is an official doc about this: how to set the default document in a Node.js app .

It uses express to solve it, Create index.js there with the following code, then restart your app then it will work.

var express = require('express');
var server = express();
var options = {
index: 'index.html'
};
server.use('/', express.static('/home/site/wwwroot', options));
server.listen(process.env.PORT);

Except this, there is another way to solve it, use pm2 since that is already part of the stack. Add the below startup command for the app:

pm2 serve /home/site/wwwroot --no-daemon

在此处输入图像描述

After restart the app, it will pick the index pages from the wwwroot.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM