image-resizer icon indicating copy to clipboard operation
image-resizer copied to clipboard

Can't make a route other than root '/'

Open LMS007 opened this issue 7 years ago • 2 comments

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?

LMS007 avatar Apr 23 '17 21:04 LMS007

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)

teohhanhui avatar May 02 '17 07:05 teohhanhui

Yep, I'm using tripviss too, otherwise it wouldn't install correctly. Yes, a separate domain makes sense, thanks for tie suggestion.

LMS007 avatar May 04 '17 23:05 LMS007