Skip to content

Commit 742a089

Browse files
chore(crawling): temporary logging
1 parent cc5283e commit 742a089

File tree

1 file changed

+7
-2
lines changed
  • packages/overmind-website/backend

1 file changed

+7
-2
lines changed

packages/overmind-website/backend/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,19 @@ const searchData = getSearchData()
106106
const googleCrawlMiddleware = async function ssr(req, res, next) {
107107
const url = req.protocol + '://' + req.hostname + req.path
108108

109-
console.log(req.get('user-agent'))
110-
console.log(req.get('User-Agent'))
109+
console.log(
110+
req.get('User-Agent'),
111+
path.extname(url),
112+
path.extname(url).length
113+
)
111114
if (
112115
req
113116
.get('User-Agent')
114117
.toLowerCase()
115118
.indexOf('googlebot') >= 0 &&
116119
!path.extname(url)
117120
) {
121+
console.log('grabbing from service')
118122
res.send(
119123
await new Promise((resolve) => {
120124
https.get(
@@ -130,6 +134,7 @@ const googleCrawlMiddleware = async function ssr(req, res, next) {
130134
})
131135
)
132136
} else {
137+
console.log('next')
133138
next()
134139
}
135140
}

0 commit comments

Comments
 (0)