This project has moved. For the latest updates, please go here.

Embedded Resources

Jan 4, 2016 at 7:20 AM
I'm new to Owin and I have an advanced question and I hope it's possible to do that.

I have an web application HTML/JS/CSS and I configured Owin Like This
    var url = "http://localhost:8080";
    var root = args.Length > 0 ? args[0] : ".";
    var fileSystem = new PhysicalFileSystem(root);

    var options = new FileServerOptions();
    options.EnableDirectoryBrowsing = true;
    options.FileSystem = fileSystem;
    options.StaticFileOptions.ContentTypeProvider = new CustomContentTypeProvider();
    options.EnableDefaultFiles = true;


    WebApp.Start(url, builder => builder.UseFileServer(options));
    Console.WriteLine("Listening at " + url);
    Console.ReadLine();
And sure enough it works when i add my project in a sub folder and navigate to it Like: http://localhost:8080/test/ What I want to do is to move my files from physical directory to embedded resources and make this embedded resources as my project folder / path for owin.

Can I do that ?? and how can I achieve this !!
Coordinator
Jan 4, 2016 at 4:44 PM
Jan 5, 2016 at 3:33 AM

can you Please give me an example cause when i browse it i can only find TestHTTP.AppResources.resources ... how i can Initiate my index.html from this embedded resource


Coordinator
Jan 6, 2016 at 9:20 PM
FileSystem = new EmbeddedResourceFileSystem("TestHTTP.AppResources.resources")
Directory browsing didn't work for some reason, but I could browse to index.html.