Get access to LocalStorage on Cross-Origin Domains.
Put the iframe.html
in your remote domain.
'use strict'; | |
var app = require('./app'); | |
var models = require('./models'); | |
var async = require('async'); | |
var _ = require('lodash'); | |
/* | |
middle-wares | |
*/ | |
var config = models.config.middleware(); |
const target = {}; | |
const handler = { | |
get(target, property, receiver) { | |
return fetch(`https://jsonplaceholder.typicode.com/${property}`) | |
.then(r => r.json()) | |
} | |
}; | |
const api = new Proxy(target, handler); |
const myPromise = () => Promise.resolve('ok'); | |
describe('Async - Await Test', () => { | |
test('Async', async () => { | |
expect(await myPromise()).toBe('ok'); | |
}) | |
}); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="friendly iframe"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
html { | |
height: 100vh; |
const express = require('express'); | |
const { json, urlencoded } = require('body-parser'); | |
const helmet = require('helmet'); | |
const cors = require('cors'); | |
const morgan = require('morgan'); | |
const debug = require('debug'); | |
const compression = require('compression'); | |
const http = require('http'); | |
const camelCase = require('lodash.camelcase'); |
heroku config | sed 's/: */=/g; /^=/d' >> .env | |
import { RequestInit } from 'next/dist/server/web/spec-extension/request'; | |
type DefaultOptions = { | |
baseUrl: string; | |
headers: Headers; | |
}; | |
const defaultOptions: DefaultOptions = { | |
baseUrl: '', | |
headers: new Headers({ |