[server] Factor out clientURLFromLocalURL so it can be reused in website-responders.js
Summary:
We're changing this logic because now that we're using Express routers directly, req.url gets the baseRoutePath for the router stripped out.
See the docs for req.originalUrl:
the “mounting” feature of app.use() will rewrite req.url to strip the mount point.
Depends on D3553
Test Plan:
- We tested the landing page, the SquadCal app, and the Comm app
- We made sure we tried configs where baseRoutePath !== basePath
- We also checked view-source to make sure things were set correctly
- We made sure there were no errors in the browser console
- We played around with the site, logging in and navigating and making sure things worked correctly
- We tried loading a specific URL for a specific chat directly
Reviewers: varun, atul, palys-swm
Reviewed By: varun
Subscribers: Adrian, karol-bisztyga, benschac, yayabosh
Differential Revision: https://phabricator.ashoat.com/D3554