I have 2 separate projects developed in .NET6. One is a web app (developed using Razor pages) and the other is WebAPI (Minimal).
I would like to publish them under the same URL i.e. mywebsite.com. The WebAPI would have the URL as mywebsite.com/api.
I published the web app and then created a Virtual Directory in IIS with Alias as api under the web app.
Both the projects have their own web.config files and appsettings.json files in the root folders.
When I try to access the WebAPI I get the HTTP 503 error.
Earlier only WebAPI project was published in the IIS and was working fine.
Some thoughts: the HTTP Handlers (end points) in the WebAPI are like this: app.MapGet("/api", () => "Welcome"); Is the path correct under new deployment structure?
The web.config has the AspNetCore module as - <aspNetCore processPath=".\WebAPI.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" /> Should it have .\api\WebAPI.exe as the path?
Any pointers please? Please let me know if any more info is needed.