Monday, 15 May 2017

Serving image paths with express js

I have on the server side a expres js. I'm serving images with:

app.use('/static', express.static(out_path));

On some querys the server return image paths. So in production that would be

https://<myApp>.com/static/<image_name>

Since I need also a dev environment the path would be

http://localhost:port/static/<image_name>

Is there an elegant solution to this problem? I could use a config or something like that, but perhaps there exist a better solution.

Thanks and best reagards



via MichaelRazum

No comments:

Post a Comment