Sending cookies with fetch, bg color change

This commit is contained in:
MrFry 2020-04-08 18:12:08 +02:00
parent 0ba12f4d67
commit 179aa6ebfa
4 changed files with 7 additions and 5 deletions

View file

@ -2,7 +2,7 @@
margin: 10px; margin: 10px;
padding: 10px; padding: 10px;
color: white; color: white;
background-color: #212127; background-color: #222426;
border: none; border: none;
font-size: 18px; font-size: 18px;
flex-grow: 1; flex-grow: 1;

View file

@ -1,7 +1,7 @@
:root { :root {
--text-color: #9999ff; --text-color: #9999ff;
--bright-color: #f2f2f2; --bright-color: #f2f2f2;
--background-color: #212127; --background-color: #222426;
--hoover-color: #202020; --hoover-color: #202020;
} }
@ -28,7 +28,7 @@ a {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: 200px; width: 200px;
background-color: #212127; background-color: #222426;
position: fixed; position: fixed;
height: 100%; height: 100%;
overflow: auto; overflow: auto;

View file

@ -10,7 +10,7 @@ class MyDocument extends Document {
return ( return (
<Html> <Html>
<Head /> <Head />
<body bgcolor='#212127'> <body bgcolor='#222426'>
<Main /> <Main />
<NextScript /> <NextScript />
</body> </body>

View file

@ -52,7 +52,9 @@ export default function Index (props) {
setData(null) setData(null)
const toFetch = `${constants.apiUrl}data.json` const toFetch = `${constants.apiUrl}data.json`
console.info('Fetching', toFetch) console.info('Fetching', toFetch)
fetch(toFetch) fetch(toFetch, {
credentials: 'include'
})
.then((resp) => { .then((resp) => {
if (resp && resp.ok) { if (resp && resp.ok) {
return resp.json() return resp.json()