1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 06:21:17 -04:00

stop terminating unexpected request methods to api endpoints

This commit is contained in:
2022-08-26 17:29:12 -04:00
parent 488bfac9c5
commit bdc8555b93
2 changed files with 3 additions and 8 deletions

View File

@@ -34,11 +34,6 @@ type SpotifyTrackSchema = {
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
try {
if (req.method !== "GET") {
// 405 Method Not Allowed
return res.status(405).end();
}
// let Vercel edge cache results for 5 mins
res.setHeader("Cache-Control", "public, max-age=0, s-maxage=300, stale-while-revalidate");