Skip to content

Commit 3a085f7

Browse files
committed
proper google verification
1 parent 96d2ee7 commit 3a085f7

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

packages/functions/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"scripts": {
99
"prebuild": "rimraf dist",
10-
"build": "tsc -p tsconfig.build.json && cp -r src/templates dist/packages/functions/src/templates",
10+
"build": "tsc -p tsconfig.build.json && cp -r src/templates dist/packages/functions/src/templates && cp -r src/functions/util/google8bc4d33afc7bc848.html dist/packages/functions/src/functions/util/",
1111
"watch": "tsc -w",
1212
"prestart": "npm run build",
1313
"start": "func start",
@@ -40,4 +40,4 @@
4040
"@types/node": "22.13.10"
4141
},
4242
"main": "dist/packages/functions/src/functions/**/*.js"
43-
}
43+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions'
2+
import * as fs from 'fs'
3+
import * as path from 'path'
4+
5+
export const googleVerification = async (req: HttpRequest, context: InvocationContext): Promise<HttpResponseInit> => {
6+
const filePath = path.join(__dirname, 'google8bc4d33afc7bc848.html')
7+
const htmlContent = fs.readFileSync(filePath, 'utf8')
8+
return {
9+
status: 200,
10+
body: htmlContent,
11+
headers: {
12+
'Content-Type': 'text/html',
13+
},
14+
}
15+
}
16+
17+
app.http('google-verification', {
18+
methods: ['GET'],
19+
route: 'google8bc4d33afc7bc848.html',
20+
handler: googleVerification,
21+
})

packages/functions/google8bc4d33afc7bc848.html renamed to packages/functions/src/functions/util/google8bc4d33afc7bc848.html

File renamed without changes.

0 commit comments

Comments
 (0)