Skip to content

Instantly share code, notes, and snippets.

View BerndWessels's full-sized avatar

Bernd Wessels BerndWessels

View GitHub Profile
dependencies: {
"react": "^16.13.1",
"x-a": "1.4.3",
"x-b": "3.2.0",
"x-c": "2.1.0",
"x-d": "2.2.8",
"x-e": "2.5.19",
"x-api": "3.5.5",
}
peerDependencies: {
"react": "^16.13.1",
"x-e": "^2.5.3",
"x-api": "^3.0.0"
}
<!DOCTYPE html>
<html>
<head>
<script>
function init() {
document.getElementById("abc").api = ...;
}
</script>
</head>
/* eslint-env browser */
import React from "react";
import ReactDOM from "react-dom";
import EmployeeSearchForm from "./employeeSearchForm"; // React implementation of the Employee Search Form micro front-end.
class BusinessSolutionEmployeeSearchFormCustomElement extends HTMLElement {
connectedCallback() {
this.render();
/* eslint-env browser */
import React from "react";
import ReactDOM from "react-dom";
import EmployeeSearchForm from "./employeeSearchForm"; // React implementation of the Employee Search Form micro front-end.
class BusinessSolutionEmployeeSearchFormCustomElement extends HTMLElement {
connectedCallback() {
this.render();
/* eslint-env browser */
class BusinessSolutionEmployeeSearchForm extends HTMLElement {
connectedCallback() {
this.render();
}
set api(val) {
this._api = val;
@BerndWessels
BerndWessels / app.dart
Created May 27, 2019 22:50
flutter dart appsync AMAZON_COGNITO_USER_POOLS access
var tokens = await _identityRepository.tokens;
var graphqlEndpoint = "https://xxxxxxxxxxxxxxxxxxxxxxxxxx.appsync-api.us-east-1.amazonaws.com";
var graphqlQuery = """
query listPets {
listPets {
id
price
type
}
}
@BerndWessels
BerndWessels / app.dart
Created May 27, 2019 22:06
flutter dart appsync AWS_IAM access
var credentials = await _identityRepository.credentials;
var graphqlEndpoint = "https://xxxxxxxxxxxxxxxxxxxxxxxxxx.appsync-api.us-east-1.amazonaws.com";
var graphqlQuery = """
query listPets {
listPets {
id
price
type
}
}
@BerndWessels
BerndWessels / app.js
Created May 26, 2019 21:13
BFF pulumi cra cognito test app
import React, {useEffect, useState} from 'react';
import logo from './logo.svg';
import './App.css';
let region = 'us-east-1';
let userPoolName = 'mybfff';
let userPoolId = 'us-east-1_xxxxxxxxx';
let userPoolAppClientId = 'xxxxxxxxxxxxxxxxxxxxxxxxxx';
let identityPoolId = 'us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';
let cognitoIdentityPoolUrl = 'https://cognito-identity.us-east-1.amazonaws.com';
@BerndWessels
BerndWessels / Query.listPets.js
Created May 26, 2019 20:36
BFF pulumi appsync resolver 1
exports.requestTemplate = {
"version": "2018-05-29",
"statements": [
"select * from Pets"
]
};
exports.responseTemplate = `
$utils.toJson($utils.rds.toJsonObject($ctx.result)[0])
`.trim();