Skip to content
Snippets Groups Projects
index.js 491 B
Newer Older
import {sanityClient as client} from '../../../../lib/sanity.server'
import { getDump } from '../lib/queries'
import { toJSONLD } from '../lib'
import { context } from '../lib/context'

export default async function handler(req, res) {
  const response = await client.fetch(getDump)
  const body = await response
Tarje.Lavik's avatar
Tarje.Lavik committed
  const json = toJSONLD(body)
Tarje.Lavik's avatar
Tarje.Lavik committed
  const jsonldData = {
    "@context": "https://muna.xyz/model/0.1/context.json",
    '@graph': json,
  }
  res.status(200).json(jsonldData)