Skip to content
This repository has been archived by the owner on Jul 19, 2020. It is now read-only.

Commit

Permalink
move facebook app id to config
Browse files Browse the repository at this point in the history
  • Loading branch information
mbjorkegren committed Mar 2, 2018
1 parent c1e5cd8 commit f837ad8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ app.get('*', function(req, res) {

var html = fs.readFileSync(path.join(__dirname, 'index.html'), {encoding: "utf8"});

html = html.replace("<%= fbAppId %>", polisConfig.FB_APP_ID);
html = html.replace("<%= useIntercom %>", !isTrue(polisConfig.DISABLE_INTERCOM));
html = html.replace("<%= usePlans %>", !isTrue(polisConfig.DISABLE_PLANS));
var domainWhitelist = '["' + polisConfig.domainWhitelist.join('","') + '"]';
Expand Down
16 changes: 9 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,21 @@ gulp.task('index', [
], function() {
// var githash = getGitHash();
var bundlePath = [destRootRest, "admin_bundle.js"].join("/");
var index = fs.readFileSync('index.html', {encoding: "utf8"});
index = index.replace("/dist/admin_bundle.js", '/' + [destRootRest, "js", "admin_bundle.js"].join('/'));
index = index.replace("NULL_VERSION", versionString);
index = index.replace("<%= useIntercom %>", !isTrue(polisConfig.DISABLE_INTERCOM));
index = index.replace("<%= usePlans %>", !isTrue(polisConfig.DISABLE_PLANS));
var html = fs.readFileSync('index.html', {encoding: "utf8"});
html = html.replace("/dist/admin_bundle.js", '/' + [destRootRest, "js", "admin_bundle.js"].join('/'));
html = html.replace("NULL_VERSION", versionString);

html = html.replace("<%= fbAppId %>", polisConfig.FB_APP_ID);
html = html.replace("<%= useIntercom %>", !isTrue(polisConfig.DISABLE_INTERCOM));
html = html.replace("<%= usePlans %>", !isTrue(polisConfig.DISABLE_PLANS));

var domainWhitelist = '["' + polisConfig.domainWhitelist.join('","') + '"]';
index = index.replace("<%= domainWhitelist %>", domainWhitelist);
html = html.replace("<%= domainWhitelist %>", domainWhitelist);

// index goes to the root of the dist folder.
var indexDest = [destRootBase, "index_admin.html"].join("/");
// fs.mkdirSync(destRootBase);
fs.writeFileSync(indexDest, index);
fs.writeFileSync(indexDest, html);
});

gulp.task('embed', [
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '661042417336977',
appId : '<%= fbAppId %>',
xfbml : true,
version : 'v2.1'
});
Expand Down
2 changes: 2 additions & 0 deletions polis.config.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ module.exports = {
DISABLE_INTERCOM: true,
DISABLE_PLANS: true,

FB_APP_ID: '661042417336977',

S3_BUCKET_PROD: 'pol.is',
S3_BUCKET_PREPROD: 'preprod.pol.is',

Expand Down

0 comments on commit f837ad8

Please sign in to comment.