http-server icon indicating copy to clipboard operation
http-server copied to clipboard

As a user I would like the ability to specify the default landing page / 404 page / magic pages

Open fitcwill opened this issue 4 years ago • 6 comments

Steps to reproduce the issue, if applicable. Include the actual command and output and/or stack trace.

Set up http-server as normal

What did you expect to happen?

Would like to see a switch or parameter for being able to specify the default page when it is not index.html. In particular for my use case, I would like this to be an extensionless 'index' or 'home' page but being able to specify it seems like the right goal.

If the issue is a feature request, what is the motivation / use case for it?

To be able to customise the default magic file. A similar approach could be used for the magic 404 page too.

Tell us about your environment

  • exact http-server version:

0.12.3

  • Node version:

12.18.4

  • Platform:

Windows 10 64 bit

Other information (related issues, suggestions for a fix, etc):

fitcwill avatar Mar 02 '21 21:03 fitcwill

Also can be useful for running React Apps which uses BrowserRouter.

uxigene avatar Jun 21 '21 22:06 uxigene

I've started this here, but I have a few unit tests to fix: https://github.com/chris--jones/http-server/tree/index-and-notfound

chris--jones avatar Oct 09 '21 12:10 chris--jones

This issue has been inactive for 180 days

github-actions[bot] avatar Apr 08 '22 12:04 github-actions[bot]

Hi there @chris--jones, any update on this issue?

burkenyo avatar Jan 19 '23 22:01 burkenyo

Hi @burkenyo, I didn't get to complete this because from memory the unit testing was a bit of a rabbit hole with intermittent failures and outdated packages. Having said that, the branch still contains all the relevant changes to have this feature functional, I guess I was hoping someone else would pick it up and finish it.

chris--jones avatar Jan 19 '23 23:01 chris--jones

the branch still contains all the relevant changes to have this feature functional, I guess I was hoping someone else would pick it up and finish it.

Good to know, @chris--jones. I may be able to work on this.

burkenyo avatar Jan 20 '23 03:01 burkenyo