I do not understand what extra functionality do /api/
routes have over getStaticProps
and getServerSideProps
.
I have seen few examples, where people like to make HTTP GET
requests using getStaticProps and getServerSideProps and use /api/
route to make PUT PATCH DELETE
requests.
Is there any official document on best practices on what to use for different use cases?