dat-gateway icon indicating copy to clipboard operation
dat-gateway copied to clipboard

Allow CORS and a default 200 response at the root

Open rjcorwin opened this issue 7 years ago • 2 comments

This enables CORs and will respond with a 200 at the root of the server. Why does this matter?

Here's a PoC I whipped up that relies primarily on a local dat-gateway when available, but falls back to a public gateway when not available locally.

The PoC Bunsen app served up through a public gateway: screen shot 2018-04-12 at 12 34 15 pm

The PoC Bunsen app serving up the requested dat through the local gateway because it is available: screen shot 2018-04-12 at 12 32 30 pm

The PoC Bunsen app serving up the requested dat through the public gateway because the local gateway is not available: screen shot 2018-04-12 at 12 32 52 pm

The CORs and the response at the root is important because before setting the iframe to the gateway, we do a preflight fetch to see if there is a 127.0.01:3000 gateway available.

rjcorwin avatar Apr 12 '18 16:04 rjcorwin

@RangerMauve - This PoC is leaning heavily on your public gateway http://gateway.mauve.moe:3000/bunsen.hashbase.io/

:)

rjcorwin avatar Apr 12 '18 16:04 rjcorwin

I think that garbados' fork is the main repo for this project now. @garbados

RangerMauve avatar Apr 12 '18 16:04 RangerMauve