Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

http-server -p 8082 showing ERR_INVALID_REDIRECT

I am working on angular project . I want to apply PWA (Progressive web app) to my application. Here are the commands I followed.

ng build --prod
cd dist/appname
http-server -p 8082

when I open the 127.0.0.1:8082/#/ or localhost:8082/#/ it is showing following error

This page isn’t working localhost sent an invalid response. ERR_INVALID_REDIRECT

How to fix it?

like image 756
JustCode Avatar asked Dec 02 '22 10:12

JustCode


2 Answers

http-server has been broken recently, you can either :

  • use version 0.9.0 explicitly in your package.json ("http-server": "0.9.0",)
  • use another package that is not based on http-server like @Ruina suggested
like image 139
Ssh-uunen Avatar answered Jan 09 '23 09:01

Ssh-uunen


You have to directly call index.html. At least that's what worked for me just now.

Try: http://127.0.0.1:8080/index.html

like image 23
Matthias Avatar answered Jan 09 '23 08:01

Matthias