Reputation: 161
Hi i'm unable to verify site in site verification process.
Step 1: verification token by calling getToken method
This is the response i'm getting from step1:
{ "token": "google12cfc68677988bb4.html", "method": "FILE" }
Step 2: Place the token on your site using whatever method you choose.
My question is how to place token (google12cfc68677988bb4.html) on site.I stuck in step 2. can any one help?
Upvotes: 0
Views: 552
Reputation: 6211
You can set up a public dir, and serve the static .html file from there:
const express = require('express')
const app = express()
app.use(express.static('public'));
app.get('/', function (req, res) {
res.send('Hello World!')
})
app.listen(7777, function () {
console.log('Example app listening on port 7777!')
})
So with : app.use(express.static('public'));
you are telling express to use the folder called public for serving static files.
Create the public directory, include the google verification .html inside and try to access it (localhost:7777/google12cfc68677988bb4.html
)
app.get('/google12cfc68677988bb4.html', function (req, res) {
res.sendFile(__dirname+"/google12cfc68677988bb4.html");
})
(I would go for the serve static instead)
Upvotes: 1