Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StaticFileRouteHandler for local directory or image file #136

Open
robp2175 opened this issue Mar 12, 2018 · 1 comment
Open

StaticFileRouteHandler for local directory or image file #136

robp2175 opened this issue Mar 12, 2018 · 1 comment

Comments

@robp2175
Copy link

What I would like to do is basically be able to go to http://ipaddress:8800/docs and access a local directory serving html files. c:\httpdocs for example.

I have been looking at StaticFileRouteHandler.cs trying to figure out how I might be able to accomplish this.

I tried something as simple as
.RegisterRoute(new StaticFileRouteHandler(@"c:\\httpdocs"))

, but that did not work. My c# abilities are lacking. If anyone could provide some direction, I would greatly appreciate it.

@robp2175 robp2175 changed the title StaticFileRouteHandler for local directoryor image file StaticFileRouteHandler for local directory or image file Mar 12, 2018
@Jark
Copy link
Collaborator

Jark commented May 26, 2018

Hi @robp2175,

There might be a problem with the rights to read a folder from a windows universal app. Check that the user you're running under has full read access to c:\httpdocs.

I would suggest starting with the HeadedDemo or HeadlessDemo, see that example work, and then try to modify it to use a different folder.

To host C:\httpdocs on \docs you would change it to the following:

.RegisterRoute("docs", new StaticFileRouteHandler(@"c:\httpdocs"))

Regards,

Jark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants