- Install
cors
package and its TypeScript types:
npm install cors
npm install --save-dev @types/cors
- Update the entry point of your Express app to allow your server to use
cors
middleware. Configure your CORS options with the origins you would like to allow.
import express from 'express';