diff --git a/app/app.js b/app/app.js index 3a2aa71..59196e9 100644 --- a/app/app.js +++ b/app/app.js @@ -44,6 +44,12 @@ app.use(bodyParser.raw( { limit: '10mb', type: 'image/*' })); app.use(logger('dev')); app.use(cors(corsOpts)); +// Serve the resized avatar files (GET /.jpg) straight from outputDir. +// The frontend reads `${avatarServiceUrl}/${hash}.jpg`; historically an nginx +// sharing the outputDir volume did this, but serving it from the node process +// keeps the deployment a single container with one port. +app.use(express.static(outputDir)); + // function store function resizeAndSave(buf, jidhash) { if (resolutions.length > 0) {