If I understand you correctly, you want to host some static html files as well as web api. This is pretty easy to do with OWIN. I'm going to assume that you already have nuget packages for the web API, so go and get the StaticFiles package . Then in Startup.Configuration you can add the following code:
var options = new FileServerOptions(); options.EnableDefaultFiles = true; options.DefaultFilesOptions.DefaultFileNames = new[] { "index.html" }; options.DefaultFilesOptions.FileSystem = new PhysicalFileSystem("Web"); options.DefaultFilesOptions.RequestPath = PathString.Empty; app.UseFileServer(options);
This will serve the files from the Web folder. By default, the file that will be served will be "index.html", and any other files in the Web folder can be accessed with their file name (that is, localhost / otherpage.html). It will not allow access to Web subfolders.
Then just make sure all WebAPI routes start with "api /"
source share