5 ms·
Congratulations on your first Go (Golang) project. The source code doesn’t do anything related with GitHub pages though. It simply starts a file server with n
by guessmyname 8y ago
Congratulations on your first Go (Golang) project.
The source code doesn’t do anything related with GitHub pages though.
It simply starts a file server with no more features than adding “.html” at the end of the URL.
You may want to change the default port from :80 to :8080 so people don’t have to set “-port” every time.
Also, in the README, you say that one of the implemented features is:
> 4. Check whether 404.html is a file, if so serve that file as a 404
But your code says otherwise [1] since there is no 404.html file in the repository.
[1] https://github.com/CurtisLusmore/ghp/blob/6b6e2bd/ghp.go#L25-L29 https://github.com/CurtisLusmore/ghp/blob/6b6e2bd/ghp.go#L25...
- clusmore 8y agoThanks for your feedback, and for taking a look. > The source code doesn’t do anything related with GitHub pages though. I'm not sure what your point is here exactly. Although the source code makes no mention of GitHub Pages, and you're more than welcome to use this for anything you'd like, it was specifically built to mimic the behaviour of GitHub Pages w.r.t. the custom 404 and the dropped .html extension. > You may want to change the default port from :80 to :8080 so people don’t have to set “-port” every time. Good point. I personally use :80 a lot but I realise :8080 is pretty standard so will use that. > But your code says otherwise [1] since there is no 404.html file in the repository. The 404.html file is not part of this repository, it's part of the directory you are serving. See https://help.github.com/articles/creating-a-custom-404-page-for-your-github-pages-site/ https://help.github.com/articles/creating-a-custom-404-page-... Edit: In case it's not clear, this is designed for testing your GitHub Page site locally, before pushing. I'll update the Readme a bit to make this clearer.
- cronix 8y ago>> The source code doesn’t do anything related with GitHub pages though. > I'm not sure what your point is here exactly. The title, "Serve Static GitHub Pages Locally," makes it sound like you're serving github pages. Maybe "serve local static pages like github does" would make it more clear.
- lucideer 8y agoHave to echo the op's remark here—what's the difference between "serving static GitHub pages locally" and "serving local static pages like github"? I can't see any possible interpretation of the former that doesn't equate to the latter. What did you assume it did when you read the title?
- SifJar 8y agodistinction is former implies it can only be used for gh pages, later implies that is one possible use amongst others