Comments (3)
Having online the Product Data
REST API on https://github.com/bodo-hugo-barwich/plack-pwa-api
The JavaScript logic can now download the data from there.
from plack-pwa-web.
Especially in the Glitch Production Environment the PWA Cache Features will be very useful since inactive projects are shut down and the restart of the project is slow.
When the Product List needs to be updated and the Glitch Site is still loading an Error occurs in the Browser and the Request does not show the correct Response Headers so that the Response cannot be shown and the Request results in a Error 404. In this case the Product List is not updated.
To inform the User about the Error a little function is implemented to inform the User about the Error.
from plack-pwa-web.
When the Product Data API at Glitch is still starting up the Request is blocked by the Browser
The Browser Request is:
GET /coffees HTTP/2
Host: plack-pwa-api.glitch.me
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
Accept: */*
Accept-Language: es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br
Origin: http://localhost:3000
Connection: keep-alive
Referer: http://localhost:3000/
Pragma: no-cache
Cache-Control: no-cache
The API Instance responds with Error 401
XHR GET https://plack-pwa-api.glitch.me/coffees [HTTP/2 401 Unauthorized 4484ms]
HTTP/2 401 Unauthorized
date: Sun, 25 Jul 2021 14:51:27 GMT
content-type: text/html; charset=utf-8
content-length: 4187
cache-control: no-cache
x-glitch-proxy: true
etag: W/"105b-QUs91cNyokmZv5A3wNhuASPDVpA"
X-Firefox-Spdy: h2
The implemented JavaScript
Logic
on xhr.status != 200
is not executed because the Browser blocks it
with the Error Message:
Solicitud desde otro origen bloqueada: la política de mismo origen impide leer el recurso remoto en https://plack-pwa-api.glitch.me/coffees (razón: falta la cabecera CORS 'Access-Control-Allow-Origin').
The Glitch Proxy Response Headers do not have the required header field Access-Control-Allow-Origin
from plack-pwa-web.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plack-pwa-web.