I am trying to view my locally served site on other devices such as my phone or another laptop. On my current laptop the site works fine, I see everything (frontend) and I get 200s when I visit the site.
However, when I try to access the site with my iphone and second laptop, I do not see any frontend but I do get 200s when I try to access the site. The terminal on my working machine also tells me that there are requests coming in.
I use Django
as a backend and I bundle/build my Javascript and CSS with webpack
and serve it with webpack-dev-server
.
When I run webpack I see this message:
http://0.0.0.0:3000/
webpack result is served from http://localhost:3000/public/bundle/
content is served from ./public
When I load my webpage on my working machine, the developer tools shows this:
and everything is working.
I run django with this command.
$ ./manage.py runserver 0.0.0.0:8000
My ifconfig
gives me:
inet 192.168.1.102
With my second laptop, I visit 192.168.1.102:8000
and I see nothing on my page. I get a 200
on my machine with the site working meaning the requests has gone through. On my second laptop I see this in the developer tools:
Notice it doesnt have /public/
in the src
and href
On my second machine if I visit 192.168.1.102:3000
I see an Interface and I am able to click around to 192.168.1.102:3000/bundle/main.js
and see my webpack built javascript.
On my second machine, I tried to change the src and href in my developer tools to 192.168.1.102:3000/bundle/main.js
. However nothing would change and I still see a blank screen
Here is a gist
of my webpack config: