From 5bf99dda88219a9551006f04bc8f4c253c90f442 Mon Sep 17 00:00:00 2001 From: Madhusudhan Srinivasa Date: Sun, 14 Sep 2014 22:11:01 +0200 Subject: [PATCH] add imager config vars --- .gitignore | 1 - README.md | 19 +++++++++++++---- config/imager.example.js | 45 ---------------------------------------- config/imager.js | 36 ++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 50 deletions(-) delete mode 100644 config/imager.example.js create mode 100644 config/imager.js diff --git a/.gitignore b/.gitignore index 084b7fb33..2d6d401e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ node_modules/ .monitor config/env/env.json -config/imager.js Makefile .DS_Store diff --git a/README.md b/README.md index 35d295e6d..c8774947d 100644 --- a/README.md +++ b/README.md @@ -22,17 +22,28 @@ Want to build something from scratch? use the [boilerplate app](https://github.c ```sh $ git clone git://github.com/madhums/node-express-mongoose-demo.git $ npm install -$ cp config/imager.example.js config/imager.js -$ npm start ``` **NOTE:** Do not forget to set the facebook, twitter, google, linkedin and github `CLIENT_ID`s and `SECRET`s. In `development` env, you can simply copy `config/env/env.example.json` to `config/env/env.json` and just replace the values there. In production, it is not safe to keep the ids and secrets in a file, so you need to set it up via commandline. If you are using heroku -checkout how environment variables are set [here](https://devcenter.heroku.com/articles/config-vars) +checkout how environment variables are set [here](https://devcenter.heroku.com/articles/config-vars). + +If you want to use image uploads, don't forget to set env variables for the +imager config. + +```sh +$ export IMAGER_S3_KEY=AWS_S3_KEY +$ export IMAGER_S3_SECRET=AWS_S3_SECRET +$ export IMAGER_S3_BUCKET=AWS_S3_BUCKET +``` -in `config/config.js`. Also if you want to use image uploads, don't forget to replace the S3 and Rackspace keys in `config/imager.js`. +then + +```sh +$ npm start +``` Then visit [http://localhost:3000/](http://localhost:3000/) diff --git a/config/imager.example.js b/config/imager.example.js deleted file mode 100644 index c0fdba01b..000000000 --- a/config/imager.example.js +++ /dev/null @@ -1,45 +0,0 @@ - -/** - * Expose - */ - -module.exports = { - variants: { - article: { - resize: { - detail: "800x600" - }, - crop: { - thumb: "200x200" - }, - resizeAndCrop: { - mini: {resize: "200x150", crop: "100x100"} - } - }, - - gallery: { - crop: { - thumb: "100x100" - } - } - }, - - storage: { - Rackspace: { - auth: { - username: "USERNAME", - apiKey: "API_KEY", - host: "lon.auth.api.rackspacecloud.com" - }, - container: "CONTAINER_NAME" - }, - S3: { - key: 'API_KEY', - secret: 'SECRET', - bucket: 'BUCKET_NAME', - region: 'REGION' - } - }, - - debug: true -} diff --git a/config/imager.js b/config/imager.js new file mode 100644 index 000000000..9aa429511 --- /dev/null +++ b/config/imager.js @@ -0,0 +1,36 @@ + +/** + * Expose + */ + +module.exports = { + variants: { + article: { + resize: { + detail: 'x440' + }, + crop: { + + }, + resizeAndCrop: { + mini: { resize: '63504@', crop: '252x210' } + } + }, + + gallery: { + crop: { + thumb: '100x100' + } + } + }, + + storage: { + S3: { + key: process.env.IMAGER_S3_KEY, + secret: process.env.IMAGER_S3_SECRET, + bucket: process.env.IMAGER_S3_BUCKET + } + }, + + debug: true +}