This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.host = functions.https.onRequest((req, res) => { | |
| const userAgent = req.headers['user-agent'].toLowerCase(); | |
| let indexHTML = fs.readFileSync('./hosting/index.html').toString(); | |
| const path = req.path ? req.path.split('/') : req.path; | |
| const ogPlaceholder = '<meta name="functions-insert-dynamic-og">'; | |
| const metaPlaceholder = '<meta name="functions-insert-dynamic-meta">'; | |
| const isBot = userAgent.includes('googlebot') || | |
| userAgent.includes('yahoou') || | |
| userAgent.includes('bingbot') || |