Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //1. -------- WEWNĄTRZ REACTA
- useEffect(()=>{
- getOk();
- },[])
- let getOk = async ()=>{
- const res = await fetch('/api/test', {
- method: 'GET',
- headers: {
- 'Accept': 'application/json',
- }
- });
- const data = await res.json();
- console.log(data);
- }
- // 2. -------------- WEWNĄTRZ EXPRESSA
- const express = require('express')
- fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));
- const router = express.Router()
- router.get('/api/test', async (req, res)=>{
- const {access}=req.cookies;
- console.log(access)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement