3

I have an Angular 2 app and want to deploy this in the IIS. I did not use Visual Studio to Create the app.

There is no sever side code running in the app as it communicates to a separate asp.net web api project for the database communication. Essentially the working files are a bunch of typescript files and and css, html.

It works fine serving it in localhost:4200

The problem is that there are literally thousands of files an an Angular 2 app.

I tried to copying the files inside 'src' folder into 'C:\inetpub\wwwroot\myProjectFolder' and changed base tag <base href="/myProjectFolder"> but simply nothing is displayed, no errors even in the Chrome console.

How would I go about in publishing Angular 2 the web app to IIS.

Thanks

2
  • Have you built the app using angular cli?
    – Bernhard
    Nov 30, 2016 at 8:44
  • Yes, I did build the app using Angular cli
    – Arianule
    Nov 30, 2016 at 8:45

1 Answer 1

11

To create a working build for the Webserver/IIS you must create a build using the angular cli. Then all the typescript resources are translated into executable javascript.

The default location where the build goes is the dist folder inside your project.

Keep also in mind to set a proper baseHref using the --bh flag if your app isn't running on domain root.

ng build --prod --bh /folder/

The output inside the dist older then looks something like this: enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.