B4J Question Access of index.html

TomDuncan

Active Member
Licensed User
Longtime User
Hi All,
I have been very busy with moving house from one state to another.
Queensland in the north of Australia to an Island called Tasmania.
I will have my Raspberry pi server up and going soon with live images and weather updates.

I am using a handler which loads each page from a database using resp.write(htm)

This is working well. However, what I can do is call a ..
(local host demo) 10.1.1.39/ctd/index.html - This works like a charm.
The request only gets the html files.
If I call a 10.1.1.39 (with the index.
It shows my www directory.

The server is setup by..

B4X:
    srvr.Initialize("srvr")
    srvr.Port = 80
    srvr.StaticFilesFolder = File.Combine(File.DirApp, "www")
    srvr.AddHandler("/ctd/*", "b4jPages", False)

How can I add a default "/ctd/index.html" for the default value.

BTW the server will be MySQL fed. Sqlite at the moment though.

Tom
 

TomDuncan

Active Member
Licensed User
Longtime User
Thanks for that. Works like a charm.
Site is also available now. Had to set port 80 with my provider.

Tom
 
Upvote 0
Top