Fix invalid SerpApi secret id

This commit is contained in:
Cohee 2023-11-19 01:41:39 +02:00
parent 211722d67b
commit 57165cbe48
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
const fetch = require('node-fetch').default;
const { readSecret } = require('./secrets');
const { readSecret, SECRET_KEYS } = require('./secrets');
/**
* Registers the SerpApi endpoints.
@ -9,7 +9,7 @@ const { readSecret } = require('./secrets');
function registerEndpoints(app, jsonParser) {
app.post('/api/serpapi/search', jsonParser, async (request, response) => {
try {
const key = readSecret('serpapi_key');
const key = readSecret(SECRET_KEYS.SERPAPI);
if (!key) {
console.log('No SerpApi key found');