aseba icon indicating copy to clipboard operation
aseba copied to clipboard

Serving local files from asebahttp and asebahttp2

Open ypiguet-epfl opened this issue 7 years ago • 4 comments

Suggestion: add support to asebahttp and asebahttp2 to also serve local files, to avoid cross-origin issues. A basic implementation with a single directory and a few mime types (html, js, css, png, jpg) would already be very useful.

ypiguet-epfl avatar Jun 19 '17 14:06 ypiguet-epfl

Agreed, it makes sense.

stephanemagnenat avatar Jun 19 '17 19:06 stephanemagnenat

I'm not sure I understand. Could you describe a test that would demonstrate this? Some URIs and their expected results would help.

There is already a plan to serve the OAS apidoc and the thymio-motion.aesl file, I am guessing that this a more general service?

davidjsherman avatar Jun 19 '17 20:06 davidjsherman

David, I'm thinking about web applications. Browsers usually restrict cross-origin requests with XMLHttpRequest (as I understand it, currently asebahttp2 is completely open with Access-Control-Allow-Origin: *). Another advantage is to avoid separate http servers or reverse proxys.

I'm not aware of development plans. Is there any link you can share?

ypiguet-epfl avatar Jun 22 '17 07:06 ypiguet-epfl

I don't have my notes on the single-page app at the office, but can dig them up. They would be PDFs extracted from my livescribe. I am sure that they weren't made public in GitHub. Plans for a single-page app drove the definition of the new asebahttp API.

Historically the CORS modification in asebahttp was made in f45c83c038e03fe99a98a8b46e76eaeed2493bf1 in response to a discussion with Pierre Rouanet, but there was no issue opened for it. About that time there was a discussion about embedding the thymio_motion.aesl file in a firmware version of asebahttp. In part to avoid cross-origin but also to permit the Thymio to act as a wireless AP.

davidjsherman avatar Jun 22 '17 08:06 davidjsherman