From 7af74ff8988961c988f03c95961b70c2918521ae Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Fri, 25 Aug 2017 09:33:53 -0400 Subject: yay --- lib/image.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 lib/image.js (limited to 'lib/image.js') diff --git a/lib/image.js b/lib/image.js new file mode 100644 index 0000000..40045b3 --- /dev/null +++ b/lib/image.js @@ -0,0 +1,5 @@ +// TODO: Put the project ID in a config file. +export default function(image, width = 300, height = 300) { + if(!image || !image.secret) return ''; + return `https://images.graph.cool/v1/cj5xz8szs28930145gct82bdj/${image.secret}/${width}x${height}`; +} -- cgit v1.3