Q:
I have tried to start with WebViewer Angular project template (https://github.com/PDFTron/webviewer-angular-sample.git). But I had a hard time deploying this to IIS Server, Are there any step-by-step instructions that I can follow?
A:
(The following steps are running on IIS 10)
-
Install URL Rewrite tool for IIS: https://devblogs.microsoft.com/premier-developer/tips-for-running-an-angular-app-in-iis/#troubleshooting
-
Add Virtual Directory to IIS
-
In virtual directory physical path, run
git clone [https://github.com/PDFTron/webviewer-angular-sample.git](https://github.com/PDFTron/webviewer-angular-sample.git) .
-
Add web.config directly to the folder above, using this content https://devblogs.microsoft.com/premier-developer/tips-for-running-an-angular-app-in-iis/#add-web-config-file-with-a-url-rewrite-rule Remember to change url="/MyApp/" to new path location
-
Run
npm install
to get all dependencies to be installed -
Run “ng build --base-href=’/YOUR_URL/’”
-
Copy contents of “Dist/Angular/” folder to this folder (beside web.config)
-
Copy the “lib” and “files” folders to your “inetpub/wwwroot” folder (otherwise I got 404 errors in the browser)
-
Goto “localhost/yoururl”
-
The WebViewer should be running in your browser now