Local Webserver extension to host / serve asset html files

My requirement is to host /serve a asset html file using a local webserver listening on a specific port (8080, 8000).

Is there a extension for creating local webserver for simple html serving ? Please let me know your suggestions / workarounds.

Appreciate your time and guidance. Thanks!

you can upload the html to media and load it by http://localhost/your.html

My need is to host the html locally and serve from a particular port.

Thanks!

You may need to explain in more detail what you are trying to do? Will one device act as a server, and other devices as clients?

When you say local, is this a fixed, single network location?

The app itself will act as server; there is no other device connecting as clients.
The initial html page presents user with "Authorize with google" , upon successful authorization, another page (redirected page) will show with insights/ details from the users authorized mail account.

I am trying to integrate the app using "Authorised redirect URIs" in google cloud API project (ref image) to authorize and redirect the page. I tested the app giving localhost without port the page never gets redirected.

yes, it is a single page app, single network location

I never used google authorizing, but I don't think the redirect url can be like http://localhost/...

When setting a redirect uri, I have never had to use an html page/location on the device. I use a proper domain url of mine on the web.

Also, how are you handling the useragent issue , when authorizing with Google ?

Please refer the screen, the Authorised redirect URIs section - When URI is given with path i.e. specific page, users will be redirected to this path after they have authenticated with Google.

The "Authorise Javascript origins" section expects only domain with HTTP origins that host the web application.

I am currently using WebViewExtra extension. I will also try out CustomWebview

Thanks for your time.

Ask yourself where exactly you are hosting/serving this web application from. Certainly not from your device. If you must have a response receiving web page, then use an online web server to provide it, and capture the response using the Web component.

Please consider this in the context of a locally hosted web application within an app, the web application is being served from the device itself, which means that the device is acting as both the client and the server. In this case, there is no need to use an online web server to provide the response.

More like using http://localhost:8000/testauth.html - this will invoke the google authorize api and subsequently redirect upon successful authorization.

In a scenario of deploying testauth.html on a website, like you mentioned website domain will replace the localhost.

Hope my requirement is clear.

Thanks Again.

Could be something like this:

https://groups.google.com/g/mitappinventortest/c/-tn-UY7YJGs/m/tpivqjkVCgAJ

This url http://localhost/.... can be accessed ONLY by yourself. The google authorize api can not access it. So you have to use a public url to let google to redirect to there.

Unfortunately both SimpleWebserver / NanoHTTPd extensions did not work - start server errored with wifi access error. I tested it on Android 13

Have you tested this ? please let me know the outcome

Thanks

Do not confuse any "localhost" uris in the Credentials if you believe they are referring to your AppInventor app location, they are not.

Sure. Currently I've setup the URI in Credentials section as "localhost:8000" is to test it on the desktop using a local webserver (amp, python SimpleHttpserver).

The tests were successful - with the initial page setup with "Sign-in with Google" and after user authorize it directs to the page I've given in the "Authorized Redirect URI" section (please refer screen shot from earlier reply).

I am now looking to deploy this as mobile app where I need your guidance on local webserver / alternatives.

Thanks Again