mirror of
https://github.com/romancm/gamebrary
synced 2025-02-17 11:38:24 +00:00
null check igdb key
This commit is contained in:
parent
8457f3e057
commit
e6ad62351b
1 changed files with 5 additions and 1 deletions
|
@ -1,7 +1,11 @@
|
|||
const functions = require('firebase-functions');
|
||||
const axios = require('axios');
|
||||
|
||||
axios.defaults.headers.common['user-key'] = functions.config().igdbv3.key;
|
||||
const envVars = functions.config();
|
||||
|
||||
axios.defaults.headers.common['user-key'] = envVars && envVars.igdbv3
|
||||
? envVars.igdbv3.key
|
||||
: 'YOUR IGDB API KEY';
|
||||
|
||||
exports.search = functions.https.onRequest((req, res) => {
|
||||
res.set('Access-Control-Allow-Origin', "*")
|
||||
|
|
Loading…
Add table
Reference in a new issue