Coded Geekery

BlogAboutContact
BlogAboutContact

CRUD API Route

For use with Next.js.

CRUD API Route
export default async function handler(req, res) { if (req.method === 'PUT') { res.status(201).json({}); } if (req.method === 'GET') { res.status(200).json({}); } if (req.method === 'POST') { res.status(200).json({}); } if (req.method === 'DELETE') { res.status(204).json({}); } }

Coded Geekery

© 2021 Roger Stringer. All rights reserved.

TwitterGitHubInstagram

Stuff

HomeAbout MeContact Me

Not Playing

Spotify