Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

608 B
Raw Blame
import { getRouterParam } from 'h3'
import { definePlatformHandler } from '../../../../../../shared/platform/runtime'
import { publicSiteContext } from '../../../../../../shared/platform/context'
import {
  authorizePublicPhoto,
  privateMedia,
} from '../../../../../../shared/platform/media'
export default definePlatformHandler(async (event) => {
  const context = await publicSiteContext(event),
    id = getRouterParam(event, 'photoId') ?? ''
  await authorizePublicPhoto(event, context, id)
  return privateMedia(
    event,
    context.site.id,
    id,
    getRouterParam(event, 'role') ?? '',
  )
})