[Next.js] Consume Next.js API routes with the SWR library on the client-side
ThecoolthingaboutNext.jsAPIroutesisthatwecandirectlyconsumetheAPIendpointsfrompages.SWRisanicetoolforhandlingdataloadingstateinReactappsusinghooks,andisaperfectcompanionforourNext.jsapplication.Inthis