From 356b92233cf0a6dba3242fb165db7610b41bc667 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 31 Oct 2023 22:47:51 -0400 Subject: [PATCH] wheeee i love vercel --- package.json | 1 + src/pages/api/spotify.ts | 10 +++++++++- src/pages/api/waiwo.ts | 9 ++++++++- src/pages/index.astro | 10 ++++++++-- yarn.lock | 5 +++++ 5 files changed, 31 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a01b64b..456b7f6 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@types/react": "^18.0.21", "@types/react-dom": "^18.0.6", "astro": "^3.4.0", + "astro-seo": "^0.8.0", "react": "^18.0.0", "react-dom": "^18.0.0", "tailwindcss": "^3.0.24" diff --git a/src/pages/api/spotify.ts b/src/pages/api/spotify.ts index 2a02a4b..4ec39fc 100644 --- a/src/pages/api/spotify.ts +++ b/src/pages/api/spotify.ts @@ -1,3 +1,5 @@ +export const prerender = false; + import type { APIRoute } from "astro"; export const GET: APIRoute = async ({ params, request }) => { @@ -21,6 +23,12 @@ export const GET: APIRoute = async ({ params, request }) => { song: track.name, nowPlaying: track["@attr"]?.nowplaying || false, url: track.url, - }) + }), + { + headers: { + "content-type": "application/json;charset=UTF-8", + }, + status: 200, + } ); }; diff --git a/src/pages/api/waiwo.ts b/src/pages/api/waiwo.ts index e7611d1..dde39b1 100644 --- a/src/pages/api/waiwo.ts +++ b/src/pages/api/waiwo.ts @@ -1,3 +1,5 @@ +export const prerender = false; + import type { APIRoute } from "astro"; export const GET: APIRoute = async ({ params, request }) => { @@ -32,5 +34,10 @@ export const GET: APIRoute = async ({ params, request }) => { return new Response(JSON.stringify({ image: null, repo }), { status: 404 }); } - return new Response(JSON.stringify({ image: image[0], repo })); + return new Response(JSON.stringify({ image: image[0], repo }), { + status: 200, + headers: { + "content-type": "application/json;charset=UTF-8", + }, + }); }; diff --git a/src/pages/index.astro b/src/pages/index.astro index ea7a9b1..623e675 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -6,7 +6,7 @@ import SocialNetworks from '../components/SocialNetworks' import TechStack from '../components/TechStack' import WAIWO from '../components/WAIWO' import PictureShowcase from '../components/PictureShowcase' - +import { SEO } from 'astro-seo' --- @@ -16,7 +16,13 @@ import PictureShowcase from '../components/PictureShowcase' - Jack Merrill +
diff --git a/yarn.lock b/yarn.lock index 471222c..0610927 100644 --- a/yarn.lock +++ b/yarn.lock @@ -879,6 +879,11 @@ array-iterate@^2.0.0: resolved "https://registry.yarnpkg.com/array-iterate/-/array-iterate-2.0.1.tgz#6efd43f8295b3fee06251d3d62ead4bd9805dd24" integrity sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg== +astro-seo@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/astro-seo/-/astro-seo-0.8.0.tgz#4d930a8fc3e23fd1b9923486843b2a85febae35d" + integrity sha512-7gq6lhibCM8FuzZIJlbLLWP5EJ9KL2/4XqeFrAg9O6ZK2xMFxJ5ubKf+a0VJwwTu8W8Xr421CmpiXu6Hq7n/7Q== + astro@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/astro/-/astro-3.4.0.tgz#d73cd96a8f96d9349c86f8e05c2f512ba4ba9287"