Get access to LocalStorage on Cross-Origin Domains.
Put the iframe.html
in your remote domain.
import { RequestInit } from 'next/dist/server/web/spec-extension/request'; | |
type DefaultOptions = { | |
baseUrl: string; | |
headers: Headers; | |
}; | |
const defaultOptions: DefaultOptions = { | |
baseUrl: '', | |
headers: new Headers({ |
heroku config | sed 's/: */=/g; /^=/d' >> .env | |
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'); |
<!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 myPromise = () => Promise.resolve('ok'); | |
describe('Async - Await Test', () => { | |
test('Async', async () => { | |
expect(await myPromise()).toBe('ok'); | |
}) | |
}); |
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); |
'use strict'; | |
var app = require('./app'); | |
var models = require('./models'); | |
var async = require('async'); | |
var _ = require('lodash'); | |
/* | |
middle-wares | |
*/ | |
var config = models.config.middleware(); |
var _ = require('lodash'); | |
var arr = [ | |
{"name":"my2child1","title":"My 2 Child 1","parent":"my2"}, | |
{"name":"my2child2","title":"My 2 Child 2","parent":"my2"}, | |
{"name":"parent","title":"A single parent"}, | |
{"name":"child-parent","title":"A child parent","parent":"child1"}, | |
{"name":"my","title":"My"}, | |
{"name":"my2","title":"My2"}, | |
{"name":"child1","title":"Child 1","parent":"my"}, |
+function(angular){ | |
'use strict'; | |
angular.module('app.services') | |
.service('MyService', function($q){ | |
var self = this; | |
var a = function(){ return $q.when({}) }; | |
var b = function(){ return $q.when({}) }; |