mirror of
https://github.com/Sosokker/openweathermap-dashboard.git
synced 2025-12-18 21:54:05 +01:00
fix: fix cors again
This commit is contained in:
parent
c7e5ee6d30
commit
3d44f74d94
@ -6,23 +6,28 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
|
if ($request_method = 'OPTIONS') {
|
||||||
if ($request_method = 'OPTIONS') {
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
add_header 'Access-Control-Max-Age' 1728000;
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||||
add_header 'Access-Control-Allow-Origin' '*';
|
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
||||||
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,
|
add_header 'Access-Control-Max-Age' 1728000;
|
||||||
X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
|
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
||||||
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
|
add_header 'Content-Length' 0;
|
||||||
add_header 'Content-Type' 'application/json';
|
return 204;
|
||||||
add_header 'Content-Length' 0;
|
}
|
||||||
return 204;
|
if ($request_method = 'POST') {
|
||||||
}
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||||
add_header 'Access-Control-Allow-Origin' '*';
|
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
||||||
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,
|
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
|
||||||
X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
|
}
|
||||||
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
|
if ($request_method = 'GET') {
|
||||||
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||||
|
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
||||||
|
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
|
||||||
|
}
|
||||||
|
|
||||||
proxy_pass http://backend:8080;
|
proxy_pass http://backend:8080;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,11 +12,13 @@
|
|||||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||||
padding: 1.5rem;
|
padding: 1.5rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
max-height: 650px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#table-section {
|
#table-section {
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
max-height: 500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#map {
|
#map {
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<div id="statistic">
|
<div id="statistic">
|
||||||
<h2>Rainfall Statistics</h2>
|
<h2>Rainfall Statistics | Rain map</h2>
|
||||||
<p>Today rain/hr.</p>
|
<p>Today rain/hr.</p>
|
||||||
<div id="table-section">
|
<div id="table-section">
|
||||||
<script>
|
<script>
|
||||||
@ -104,7 +104,7 @@
|
|||||||
const lat = weatherData.map((location) => location.coord.lat);
|
const lat = weatherData.map((location) => location.coord.lat);
|
||||||
const text = weatherData.map(
|
const text = weatherData.map(
|
||||||
(location) =>
|
(location) =>
|
||||||
`${location.name}: ${location.rain["1h"]} mm/hr (${location.weather[0].description})`
|
`${location.name}: ${location.rain["1h"]} mm/hr)`
|
||||||
);
|
);
|
||||||
|
|
||||||
const data = [
|
const data = [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user