From c58266b2dabb3afdd6027c0335af2207b86a1c0f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 13 May 2017 21:14:56 +0200 Subject: route hotlinking photo --- index.js | 5 +++++ lib/awmail/index.js | 6 +++--- templates/photo.liquid | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 templates/photo.liquid diff --git a/index.js b/index.js index 434109d..ff727f2 100644 --- a/index.js +++ b/index.js @@ -10,6 +10,10 @@ var viewConfig = { ] } +var photoConfig = { + template: 'photo', +} + var app = okcms.createApp({ project: 'Hansel and Gretel', @@ -59,6 +63,7 @@ var app = okcms.createApp({ '/timeline': viewConfig, '/timeline/:id': viewConfig, '/page/:id': viewConfig, + '/photo/:id': photoConfig, }, services: { diff --git a/lib/awmail/index.js b/lib/awmail/index.js index 5ef6840..159960e 100644 --- a/lib/awmail/index.js +++ b/lib/awmail/index.js @@ -58,9 +58,11 @@ function AWMail (options) { }) }).then(function(url){ console.log("parse templates") - console.log(url) + // https://marsupial.s3.amazonaws.com/armory/mail/260b1e90-380e-11e7-b0c0-190f661d482a.jpg + var hash = url.replace('https://marsupial.s3.amazonaws.com/armory/mail/','').replace('.jpg','') var templateData = { email: email, + hash: hash, } return parseTemplates(templateData) }).then(function(mailData){ @@ -120,8 +122,6 @@ function AWMail (options) { function uploadImage (data){ return Q.Promise(function(resolve, reject, notify) { - console.log(data.file) - upload.put({ file: data.file, preserveFilename: false, diff --git a/templates/photo.liquid b/templates/photo.liquid new file mode 100644 index 0000000..de229fa --- /dev/null +++ b/templates/photo.liquid @@ -0,0 +1,15 @@ + + + +Hansel and Gretel - Armory on Park + + + + + + -- cgit v1.2.3-70-g09d2