CORS HEADER

This commit is contained in:
fred 2022-10-30 01:00:39 +02:00
parent 1e928d3246
commit 2ac37508c8
2 changed files with 14 additions and 3 deletions

View File

@ -50,6 +50,7 @@ while true; do
# REPLACE myIP in http response template
sed "s~127.0.0.1:12345~$myIP:$PORT~g" $HOME/.zen/Astroport.ONE/templates/index.http > ~/.zen/tmp/123/${MOATS}.myIP.http
sed -i "s~127.0.0.1~$myIP~g" ~/.zen/tmp/123/${MOATS}.myIP.http
sed -i "s~:12345~:$PORT~g" ~/.zen/tmp/123/${MOATS}.myIP.http
sed -i "s~_IPFSNODEID_~${IPFSNODEID}~g" ~/.zen/tmp/123/${MOATS}.myIP.http ## NODE PUBLISH HOSTED WHAT'S JSON
sed -i "s~_HOSTNAME_~$(hostname)~g" ~/.zen/tmp/123/${MOATS}.myIP.http ## HOSTNAME

View File

@ -1,11 +1,14 @@
HTTP/1.1 200 OK
Server: Astroport
Content-Type: text/html; charset=UTF-8
Access-Control-Allow-Origin = "*"
Access-Control-Allow-Credentials = "true"
Access-Control-Allow-Methods = "GET"
<!doctype html>
<html>
<head>
<meta http-equiv="refresh" content="60; url='http://127.0.0.1:12345'" />
<meta http-equiv="refresh" content="6; url='http://127.0.0.1:12345'" />
<style>
#reduce42 {
width:42%;
@ -19,7 +22,7 @@ Content-Type: text/html; charset=UTF-8
<h2>Astroport Ŋ1 Swarm#0</h2>
<b>--- Astronaute ---</b><br>
<form action = "http://127.0.0.1:1234" method = "GET">
<form id="formlink" action = "http://127.0.0.1:1234" method = "GET">
<br>
<b>Saisir vos clefs pour recevoir votre Visa Libre par email</b></br>
Phrase Une ("identifiant") : <input name=salt value=''></br>
@ -28,9 +31,16 @@ Content-Type: text/html; charset=UTF-8
Email : <input name=email value=''></br></br>
<input type='submit' value='OCCUPER CET ESPACE'>
</form>
<h3>[<a href="http://127.0.0.1:12345">VISITER LE PORT SUIVANT</a>]</h3>
<div id="linkresultat">
<h3>[<a href="http://127.0.0.1:12345">DECOUVREZ LA REPONSE SUR LE PORT :12345</a>]</h3>
</div>
<br>
<a href="http://127.0.0.1:8080/ipns/_IPFSNODEID_" target="json"><img width=420 height=420 src='http://127.0.0.1:8080/ipfs/QmbY3R4UV43Bz7eQDEYgXZKWnszArGwnJqMmfSZ7CCWFcq' id='API'/></a>
</center>
</body>
<script>
</script>
</html>