Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publish WebApi to Subfolder

I have an out-of-the-box Visual Studio 2013 SPA using WebApi. I added Twitter authentication to Startup.Auth.cs and all of it works just fine when I publish to the root of an IIS web site or when I debug in VS with localhost.

What I can't figure out is how to publish the project to a subfolder like this:

enter image description here

In other words, http://localhost/api

The site itself works. It is the ReturnUrl from Twitter that always redirects to http://localhost/# It includes the correct access_token but in this format:

http://localhost/#access_token=fzgSLjF4W0QAHlhsNFZI...

If I manually type in "api/" before #access_token it opens the default Index page and is authenticated via Twitter. I have tweaked every setting on the Twitter side, javascript, and .cs. I just can't find a solution other than Publish to a root web site. I would like to publish to a subfolder application.

Suggestions?

like image 482
smoore4 Avatar asked Aug 26 '15 08:08

smoore4


1 Answers

See this answer

Use the Visual Studio "Web Deploy" publish method.

Set "Site name" to localhost/api instead of localhost

like image 181
Josh Avatar answered Sep 16 '22 19:09

Josh