Skip to content

Commit

Permalink
add imager config vars
Browse files Browse the repository at this point in the history
  • Loading branch information
madhums committed Sep 14, 2014
1 parent d75536b commit 5bf99dd
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 50 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node_modules/
.monitor
config/env/env.json
config/imager.js
Makefile
.DS_Store
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)

Expand Down
45 changes: 0 additions & 45 deletions config/imager.example.js

This file was deleted.

36 changes: 36 additions & 0 deletions config/imager.js
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 5bf99dd

Please sign in to comment.