Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Conversation

bateskevin
Copy link
Contributor

@bateskevin bateskevin commented Oct 15, 2018

Edited the Function New-PolarisStaticRoute.ps1 in a way, that it will recognize default files in the folderpath where it points to. The other rules still get created recursively.

Supported default files (For now. Only have to extend the array $StandardHTMLFiles to add more):

  • index.html
  • index.htm
  • default.html
  • default.htm

Hope this suits your needs.

Cheers,
Kevin

*Edit from maintainer:
Link to Issue #17

…and test New-PolarisStaticRoute.Tests.ps1 edited.
@msftclas
Copy link

msftclas commented Oct 15, 2018

CLA assistant check
All CLA requirements met.

Copy link
Contributor

@Tiberriver256 Tiberriver256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bateskevin this is awesome! I added a few things to change here but this looks really good. Thank you.

@bateskevin
Copy link
Contributor Author

@Tiberriver256 Thanks for the feedback! I agree with your suggested changes. How does this usually work? Should I implement these Changes on my fork and make a new PR? I've never done this before :)

@Tiberriver256
Copy link
Contributor

If you make changes on your StaticRoutesDefaultFiles branch this pull request should automatically pick up on those changes and should highlight what's changed in the latest commits on that branch.

@Tiberriver256 Tiberriver256 changed the title Issue #17. Fix #17: Adding default files for static routes Nov 1, 2018
@bateskevin
Copy link
Contributor Author

Ok, I'll try to apply the changes you suggested this weekend if I find some time.

@TylerLeonhardt
Copy link
Member

gentle ping @bateskevin don't want this PR to disappear!

@Tiberriver256
Copy link
Contributor

@TylerLeonhardt - I updated with the suggested changes. I believe I've got it ready if you want to give it a quick look over when you get a chance.

I feel like there's some awkwardness around having a default file and a directory browser enabled at the same time. I'm not 100% sure what to do about it though. I was thinking parameter sets but ended up going with defaulting the directory browser to false, let me know if you have any other ideas.

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Dec 15, 2018

Sorry for the delay! I think the behavior we're looking for is like what python does with:

python -m SimpleHTTPServer 8000

if there's a default file in the directory, we load that. If there is no default file, then we load the directory browser.

I'm not married to that idea though. What do you think @Tiberriver256?

@Tiberriver256
Copy link
Contributor

Tiberriver256 commented Dec 16, 2018

Sounds good to me. So I set the default value for directory browser and default files to true and made sure the check for default files is above the check to see if the $localpath variable is a container.

Should match python simpleHttpServer now.

@Tiberriver256
Copy link
Contributor

@TylerLeonhardt - Could you kick off the tests one more time for this? I think I should have it now.

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Dec 17, 2018

why do they disappear sometimes 😆 Kicked 👍

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I'm excited to have this completely replace python SimpleHTTPServer for me now!

@bateskevin
Copy link
Contributor Author

Hey folks, sorry this went a little under my radar. Had no time to code in the last few weeks in my time off. Glad to see that this could be completed tho!

@Tiberriver256 Tiberriver256 merged commit cf11182 into PowerShell:master Dec 17, 2018
@Tiberriver256
Copy link
Contributor

@bateskevin - No problem man. Thanks so much for getting this started. Jump on another one any time if you like :)

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

Successfully merging this pull request may close these issues.

4 participants