I’ve built an API using firebase cloud functions and I want to set up redirects on Netlify to redirect to those http functions so I can use my domain to keep branding consistent.
Let’s say my project on firebase is firebaseproj
and my domain on Netlify is example.com
. The URL endpoint generated by firebase functions is:
https://us-central1-firebaseproj.cloudfunctions.net/apiRoutes
Behind that endpoint is an express instance that can handle multiple routes e.g.:
/year/2021/month/02/day/1
So the combined URL is: https://us-central1-firebaseproj.cloudfunctions.net/apiRoutes/year/2021/month/02/day/1
How would I write the redirect so the information about year, month and day is transferred to the redirect granted the link was:
example.com/year/2021/month/02/day/1
Tl:DR I want to redirect:
http://example.com/year/2021/month/02/day/1
to
https://us-central1-firebaseproj.cloudfunctions.net/apiRoutes/year/2021/month/02/day/1
but the year, month and day is user defined and therefore dynamic