Created
October 16, 2012 05:55
-
-
Save cyu/3897427 to your computer and use it in GitHub Desktop.
Example connect-emma server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
emmaConfig = | |
namespaces: | |
deals: # deal pics optimized for mobile | |
urlTemplate: 'http://cloud.scoutmob.com/upload/images/deals/$1/original.$extension' | |
cacheExpiration: 14 * 24 * 60 * 60 # 14 days | |
processImage: (gm) -> gm.quality(60) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
connect = require 'connect' | |
emma = require 'connect-emma' | |
emmaConfig = | |
namespaces: | |
deals: # deal pics optimized for mobile | |
urlTemplate: 'http://cloud.scoutmob.com/upload/images/deals/$1/original.$extension' | |
cacheExpiration: 14 * 24 * 60 * 60 # 14 days | |
processImage: (gm) -> gm.quality(60) | |
port = 8080 | |
app = connect() | |
.use(connect.logger()) | |
.use(emma(emmaConfig)) | |
.use(connect.errorHandler()) | |
.listen(port) | |
console.log("Server started on port #{port}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment