Added logging to debug.
This commit is contained in:
parent
f2ada3bdd3
commit
6112f30363
@ -4,18 +4,22 @@ import axios from 'axios';
|
||||
export const handler: Handler = async (event: HandlerEvent, context: HandlerContext) => {
|
||||
try {
|
||||
const apiKey = event.headers['Api-Key'];
|
||||
console.log(apiKey.substring(-5));
|
||||
const query = event.body;
|
||||
console.log(query);
|
||||
const response = await axios.post('https://api.newrelic.com/graphql', // use account token to get a temp user token
|
||||
query,
|
||||
{headers: {'Api-Key': apiKey, 'Content-Type': 'application/json'}});
|
||||
|
||||
const data = await response.data;
|
||||
console.log(data)
|
||||
return {
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
statusCode: 200,
|
||||
body: JSON.stringify(data)
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return {
|
||||
statusCode: 500,
|
||||
body: JSON.stringify(error)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user