Skip to content

Instantly share code, notes, and snippets.

View dksheffield's full-sized avatar

David Sheffield dksheffield

  • Douglas GA
View GitHub Profile
function getCognitoCreds() {
console.log("starting function getCognitoCreds");
var cognitoUser = cognitoFactory.getCognitoUser();
cognitoUser.getSession(function(err, session) {
if (err) {
console.log(err, err.stack);
console.log("error getting the session");
} else {
if (session.isValid() === false) {
console.log("session is not valid");
@dksheffield
dksheffield / gist:6e08182f695d8276afdf9d8a57bd868e
Created March 6, 2017 17:38
not-serverless-cft-output.yaml
ContactUsFormApi:
Properties:
Body:
basePath: /dksheffield/ContactUsForm/1.0.0
host: virtserver.swaggerhub.com
info:
contact:
email: jeremiah.sheffield@gmail.com
description: Contact Us API
license:
ContactUsFormApi:
Type: "AWS::ApiGateway::RestApi"
Properties:
Description: "A test API"
Name:
Ref: AWS::StackName
Body:
swagger: '2.0'
info:
description: Contact Us API
@dksheffield
dksheffield / template.yaml
Created March 6, 2017 16:33
Sample Serverless API
ContactUsFormApi:
Type: "AWS::Serverless::Api"
Properties:
StageName: prod
DefinitionBody:
swagger: '2.0'
info:
description: Contact Us API
version: 1.0.0
title:
console.log('Loading function');
var Promise = require('promise');
doPromiseOne()
.then(doPromiseTwo)
.then(doPromiseThree);
function doPromiseOne() {