image-resizer
image-resizer copied to clipboard
Can't make a route other than root '/'
I'm trying to integrate this with my app but I'm using the root route for the home page "/"
app.get('/' ....
So, since that is taken, then I would like something like this for my images...
app.get('/images/*?', function(request, response){
var image = new Img(request);
image.getFile()
.pipe(new streams.identify())
.pipe(new streams.normalize())
.pipe(new streams.resize())
.pipe(new streams.filter())
.pipe(new streams.optimize())
.pipe(streams.response(request, response));
});
However that forces me to have all my images in an images
folder in my S3 bucket and I don't like have that not-so-explicit coupling between my app and S3. Is there some config I'm not aware of?
I'd recommend using a separate subdomain. This project was designed to be placed behind a CDN, so I think that makes a lot of sense.
(This project has been inactive for a long time. You might want to check out our fork at https://github.com/tripviss/image-resizer)
Yep, I'm using tripviss too, otherwise it wouldn't install correctly. Yes, a separate domain makes sense, thanks for tie suggestion.