Message Boards Message Boards

Use index.html files in Wolfram Cloud sites?

GROUPS:

Cross post on StackExchange: https://mathematica.stackexchange.com/questions/162265/using-index-html-files-in-wolfram-cloud-sites


Part as exercise, part so I could write data-science blog posts I built a website builder using Mathematica that sets up sites in the cloud.

As an example site, here is a paclet server website I set up: https://www.wolframcloud.com/objects/b3m2a1.paclets/PacletServer/main.html

Unfortunately, to get this to work I had to remap my site's index.html file to a main.html file, because when I try to view the site at the index.html either by explicitly routing there or by going to the implicit view I am pushed back to the implicit view and given a 500 error.

Note that I cannot copy the index.html file to the site root i.e.,

CopyFile[
 CloudObject["https://www.wolframcloud.com/objects/b3m2a1.paclets/PacletServer/index.html"],
 CloudObject["https://www.wolframcloud.com/objects/b3m2a1.paclets/PacletServer", Permissions->"Public"]
 ]

as I get a CloudObject::srverr failure

I can't even set up a permanent redirect like so:

CloudDeploy[
 Delayed@HTTPRedirect[
   "https://www.wolframcloud.com/objects/b3m2a1.paclets/PacletServer/main.html",
   <|"StatusCode" -> 301|>
   ],
 "server",
 Permissions -> "Public"
 ]

CloudObject["https://www.wolframcloud.com/objects/b3m2a1.paclets/server"]

As while this apparently worked, going to that site causes my browser to spin infinitely and before finally giving up.

Even more, all of these possible hacks are ugly and I'd much rather work with the standard website setup.

How can I do this?

POSTED BY: b3m2a1 ​ 
Answer
4 months ago

What you're doing now is the best way to do such a thing. We have plans to do better though, to do something like designate a cloud object (such as index.html) to serve as the "face" of any cloud directory, not just the $CloudRootDirectory.

POSTED BY: Joel Klein
Answer
4 months ago

Wonderful! I look forward to that.

POSTED BY: b3m2a1 ​ 
Answer
4 months ago

Any idea what the timeline for this might be? I'm assuming it doesn't have to be pinned to the standard Mathematica release schedule, being a Cloud feature.

POSTED BY: b3m2a1 ​ 
Answer
3 months ago

Cloud software releases much more often than Mathematica (try CloudEvaluate[$CloudVersion, CloudBase -> "https://www.wolframcloud.com"] to check what the current version is and when it was built), and the Wolfram Language side to contact the cloud is largely contained in the CloudObjects paclet that is pushed to the public paclet servers at the same time that the cloud software is changed.

I can't comment on release specifics officially, but I can say it is being actively worked on.

POSTED BY: Joel Klein
Answer
3 months ago

One final follow up on this. When this feature finally gets rolled out, whenever that might be, how will we know? I can't say I really know where to look for an up-to-date listing of the cloud's various features--or if such a (very useful) listing exists.

POSTED BY: b3m2a1 ​ 
Answer
3 months ago

I've linked this thread in the ticket where we're implementing this. We'll reply back on this thread when we push this support.

We've had release notes in the past, it may be getting a comeback.

POSTED BY: Joel Klein
Answer
3 months ago

Any progress? The more I use my cloud resources and share them with others the more others are confused why the cloud doesn't work like a website should. (i.e why they have to go to https://www.wolframcloud.com/objects/b3m2a1.paclets/PacletServer/main.html when experience dictates https://www.wolframcloud.com/objects/b3m2a1.paclets/PacletServer/ should suffice).

POSTED BY: b3m2a1 ​ 
Answer
1 month ago

Group Abstract Group Abstract