Where We Start
You can refer to my last blog to understand how I came along. What happened after that is:
- Deployed the empty ASP.NET project with Quick Start example to Azure through Visual Studio 2015
- run npm install in the console of Azure
If you see the node_modules folder, then it works, even you might receive Bad Request error.
Of course, it does not work, or why else am I writing this blog. It seems that all the requests of the .js files under /node_module/.. folder are rejected, and the server just return the default file under the dir, which is the /src/index.html itself:
Yeah….it is an official boilerplate app, but not cloud-platform-deployable.
Step 1: change the index.html, removing the base tag:
Step 2: change the file structure, the dir structure of the example is:
root |--node_modules | |--... | |---src |--app | |--app.component.html | |--... | |--index.html |--favicon.ico |--main.js |--main.js |--styles.css
All you need to do is change it to be:
root | |--app | |--app.component.html | |--... | |--node_modules | |--... | |--index.html |--favicon.ico |--main.js |--main.js |--styles.css
Pretty simple and straightforward, move the file and folders under /src/ to the root folder.
The only problem is, how do you do that on Azure, I used a tool called Kudu. Open the tool by navigating to:
And you can manage the files from there:
Here is a good tutorial talking about Kudu.
Step 3: not really necessary, delete the useless files/folders, there are quite a lot
My question on stackoverflow.