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

{}""]"]"]"]vb,r,r,heu{}e{}e{}e{}riwdasl""r""i"""d""]idsuisdrsdpeshosrstoeeoeeroe{{{}{}n"ceeuscusrsua,":""srttrtm"rd"""""":::"ciscia:cekkkvkv[:en"ennereeeaea2"""a:"ae["syyylyl,s@[:t:tn:""""u"urvi[it::::e:ece""""""/rnn:/[""":":ica"""aAAAAnep:,:tpccc"c"dliricccGcXe//""u/eeeEe-xnd//e(sssTsC.otsa.sss,sStdsrp*---O-Rse(ci)CCCPCF""./"oooTo-,id,nnnInT)nttttOto"dsrrrNrk,e"oooSoex,lll,ln.---P-,tAAAAAslllTlX"lllCl-oooHoRwww,we---D-qCOMEHurreLeeeitEasdghTdteioEeennd,rdt"sPs-i,"O"Wa,S,il"Ttsv,h"aP,,lUuTA"e"cv"ca:elpu"te*,"":A}c",cterpute-"Ve}r,sion,Content-Length,Content-MD5,Content-Type,Date,X-Api-Version"

Summary

I hope this serves as a helpful reference.