question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add fallback to index.html

See original GitHub issue

Please add fallback to index.html for every “not real” file, pretty much the same way as connect-history-api-fallback does (https://github.com/bripkens/connect-history-api-fallback#introduction):

  1. The request is a GET request
  2. which accepts text/html,
  3. is not a direct file request, i.e. the requested path does not contain a . (DOT) character and
  4. does not match provided pattern

Not sure if I am not creating a duplicate, but I haven’t found one… I only found a fork: https://github.com/riceboyler/http-server.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:23
  • Comments:18 (3 by maintainers)

github_iconTop GitHub Comments

19reactions
kudcommented, Mar 24, 2017

However I wonder why this option is not in this current project.

17reactions
kudcommented, Mar 24, 2017

For people who need it:

$ npm install spa-http-server --save-dev
"test:dev": "npm run build && http-server dist -p 8080 --push-state",

Note that spa-http-server replaces http-server bin.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node http-server to respond with index.html to any request
This implementation will always respond with index.html if the requested file is not found, and it's almost as simple as using http-server , ......
Read more >
How to Setup Web Hosting Fallback to index.html - General
I'm hosting a Single Page App from a subdirectory of root/web. I need to redirect all calls to urls in that directory to...
Read more >
Web app routing with fallback | Better world by better software
the web application in index.html initializes itself, looks at location and routes to /about view. Not only this is a much better experience...
Read more >
mod_dir - Apache HTTP Server Version 2.4
A file written by the user, typically called index.html . The DirectoryIndex directive sets the name of this file. This is controlled by...
Read more >
connect-history-api-fallback v2.0.0
This tiny middleware addresses some of the issues. Specifically, it will change the requested location to the index you specify (default being /index.html...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found