Created
June 26, 2019 19:01
-
-
Save cbarley10/a4392bad3e8dd6afa6b0f889f057d6e8 to your computer and use it in GitHub Desktop.
CRM Extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const bodyParser = require("body-parser"); | |
const app = express(); | |
app.use(express.static(__dirname + "/public")); | |
app.use(bodyParser.urlencoded({ extended: true })); | |
app.set("view engine", "ejs"); | |
const headers = { | |
"Content-Security-Policy": | |
"default-src 'self' *.proposify.co s3.amazonaws.com; img-src * data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' *.stripe.com *.heapanalytics.com *.segment.io *.segment.com *.intercom.io *.intercomcdn.com *.googletagmanager.com tagmanager.google.com *.visualwebsiteoptimizer.com *.cloudfront.net *.google-analytics.com *.facebook.net *.ads-twitter.com *.facebook.com *.t.co *.twitter.com *.intercomassets.com *.clearbit.com *.zapier.com *.marketo.net *.mktoresp.com *.bizographics.com *.linkedin.com *.appcues.com https://zapier.com *.driftt.com *.olark.com *.growsumo.com js.recurly.com *.proposify.co s3.amazonaws.com; style-src 'self' 'unsafe-inline' *.intercomcdn.com *.gravatar.com *.wp.com *.amazonaws.com *.cloudfront.net *.olark.com *.proposify.co s3.amazonaws.com; connect-src 'self' wss: *.intercom.io *.segment.io *.intercomcdn.com *.intercomusercontent.com *.clearbit.com *.profitwell.com *.mktoresp.com *.delighted.com *.olark.com grsm.io emitter2.proposify.co *.proposify.co s3.amazonaws.com; media-src 'self' *.youtube.com *.istaging.com *.vimeo.com *.wistia.com *.wistia.net *.intercomcdn.com *.olark.com *.proposify.co s3.amazonaws.com; font-src 'self' *.intercomcdn.com *.proposify.co s3.amazonaws.com; frame-src 'self' app.hubspot.com *.zapier.com *.youtube.com *.youtube-nocookie.com *.vimeo.com *.wistia.com *.istaging.com *.wistia.net *.facebook.com *.stripe.com *.appcues.com https://intercom-sheets.com *.driftt.com *.olark.com *.hubspot.com app.hubspot.com *.proposify.co s3.amazonaws.com; worker-src 'self' data: *.hubspot.com app.hubspot.com *.proposify.co s3.amazonaws.com" | |
}; | |
const data = { | |
results: [ | |
{ | |
objectId: 1, | |
title: "Test Object 1", | |
quoteDate: "2019-03-11", | |
quoteLink: { | |
value: "https://obscure-cliffs-47038.herokuapp.com/iframe", | |
linkLabel: "Link to iFrame" | |
}, | |
totalPremium: { | |
value: 5772.88, | |
currencyCode: "USD" | |
}, | |
actions: [ | |
{ | |
type: "IFRAME", | |
width: 899, | |
height: 748, | |
uri: "https://obscure-cliffs-47038.herokuapp.com/iframe", | |
label: "View", | |
associatedObjectProperties: [] | |
} | |
] | |
}, | |
{ | |
objectId: 2, | |
title: "Test Object 2", | |
quoteDate: "2019-03-20", | |
quoteLink: { | |
value: "https://obscure-cliffs-47038.herokuapp.com/iframe", | |
linkLabel: "Link to iFrame" | |
}, | |
totalPremium: { | |
value: 5000, | |
currencyCode: "USD" | |
}, | |
actions: [ | |
{ | |
type: "IFRAME", | |
width: 899, | |
height: 748, | |
uri: "https://obscure-cliffs-47038.herokuapp.com/iframe", | |
label: "View", | |
associatedObjectProperties: [] | |
} | |
] | |
} | |
] | |
}; | |
app.get("/", (req, res) => { | |
res.set(headers); | |
res.send(data); | |
}); | |
app.get("/test", (req, res) => { | |
res.send({ data: 23423, data2: 23423252354 }); | |
}); | |
app.get("/iframe", function(req, res) { | |
res.set(headers); | |
res.render("iframe"); | |
}); | |
app.listen(process.env.PORT || 3000, () => { | |
console.log(`App Started`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment