0

I have an application I'm deploying to azure. It's a SPA app which uses REST API.

I placed the folder of the app in side the wwwroot folder.

when I try to access the API from my local machine i.e. my localhost:1979/api/auth/login I can do it but after I place the files in the www folder - I get a 404 when trying to access: domain.com/api/auth/login

I tried doing it on my machine on my local IIS and got the same error.

I'm sure it's a stupid thing like configuration but I can't figure it out.

Thanks for any help

Ace
  • 831
  • 2
  • 8
  • 28
  • did you make the app into a virtual Application in IIS? – gh9 Dec 31 '15 at 16:18
  • what does it mean "virtual". I don't know about this term. I have a regular application I set up. – Ace Dec 31 '15 at 18:41
  • Will answer your virtual app query. If you are deploying the wwwroot folder then that would be considered as base dir for your web app but if you have a folder inside the wwwroot folder then your access to the base dir will be /{folder}/app but only when you create a [virtual application in IIS like this](http://stackoverflow.com/questions/5500326/whats-the-difference-between-web-app-and-virtual-folder-in-the-context-of-iis-7) – lazy Dec 31 '15 at 19:08

1 Answers1

0

Solved Ok. So I checked the issue on my local IIS and got the same problem. The thing is, I created a directory inside an existing solution which have the web api + mvc.net and called the directory which contains the html i.e. mydomain.com/dist/index.html directly.

The solution was to send the html file via the controller so when a user comes in to the site, the home controller will send the html file and the ajax call from the JS file which was download from the html will succeed unlike getting the html directly.

Ace
  • 831
  • 2
  • 8
  • 28