From e6030ab4c00f0b18bdb9942776dd59d4a7bd57a0 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 12 Aug 2023 23:32:47 -0500 Subject: [PATCH] don't minify /.json --- src/routes/.json/+server.ts | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/src/routes/.json/+server.ts b/src/routes/.json/+server.ts index a197493..99e3594 100644 --- a/src/routes/.json/+server.ts +++ b/src/routes/.json/+server.ts @@ -5,13 +5,28 @@ export const prerender = true // this page exists so requesting the website with Accept: application/json works export const GET: RequestHandler = async ({}) => { - return json({ - title: 'matdoesdev', - description: [ - "I'm mat, I do full-stack software development.", - "This portfolio contains my blog posts and links to some of the projects I've made.", - ], - socials: ['//github.com/mat-1"', '//matrix.to/#/@mat:matdoes.dev', '//ko-fi.com/matdoesdev'], - links: ['/blog', '/projects'], - }) + return new Response( + JSON.stringify( + { + title: 'matdoesdev', + description: [ + "I'm mat, I do full-stack software development.", + "This portfolio contains my blog posts and links to some of the projects I've made.", + ], + socials: [ + '//github.com/mat-1"', + '//matrix.to/#/@mat:matdoes.dev', + '//ko-fi.com/matdoesdev', + ], + links: ['/blog', '/projects'], + }, + null, + 2 + ), + { + headers: { + 'content-type': 'application/json', + }, + } + ) }