Firebase Functions Middleware Approach
Initially, tried using the express-cors way but ended up causing the firebase functions https to be overwritten for some reason or another and had to rebuild everything and not do that. Instead, tried my own middleware that mimics how express works in how you call it.
I'm not trying to reuse existing middleware from express at this time but might be worth it at some point.
Use like so:
import {onRequest} from './middleware';
import {cors} from './cors';