Running Without Localhost

I can run the project using localhost, but when file:///…/index.htm is formatted, it doesn’t load.

Tests

Route

{
    path: "/",
    content: '<div class="page">Hello</div>'
}

Web Server

http://localhost:8080

Works.

Local

file:///directory/index.html

It doesn’t work.

Anyone able to run their project without web server? I need to know this to continue.

It was important for me to work without localhost in order to be able to run android features. I found a way to run it on localhost as well. Running without a web server is not a big deal right now.

@myFree.1 it would be nice if you share your solution - in case others looking for the same use-case.

Btw. you also can hot-reload on the file:// protocol, if you add:

writeToDisk: true

to

webpack.config.js > devServer

I was getting a build using parcel. I then tried to display it in Android WebView it didn’t work as it got it as file:///.../index.html. Later, when the application started, I created a web server and added it to the web view as http://localhost and now it works. I’m using DroidScript to convert my project to android, I couldn’t access android from within the presentation, I solved the problem by adding this: app.SetOptions("AllowRemote")