Overview#
This is a memo on how to handle CORS for Express deployed on Vercel using vercel.json.
Background#
I implemented CORS handling for the program introduced in the following article.
The following was used as a reference.
https://vercel.com/guides/how-to-enable-cors
Method#
The solution is as follows. While there may be other approaches, adding headers resolved the issue.
https://github.com/nakamura196/dts-typescript/commit/4c28f66b2af68950656dcb812f3e941d1b9b5feb
Summary#
I hope this serves as a helpful reference.