import { Router } from 'express';
import { ImageController } from '../controllers/image.controller';

/**
 * Public image routes mounted at `/images`.
 *
 * Routes:
 *  - GET /images/:type/:filename Serve a stored image (network or token thumbnail).
 *                                 type: 'networks' | 'tokens'
 *                                 filename: {uuid}.{ext}
 */
export const createImageRoutes = (controller: ImageController): Router => {
  const router = Router();

  router.get('/:type/:filename', controller.getImage);

  return router;
};
