-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b18686d
commit 5398627
Showing
8 changed files
with
5,725 additions
and
3,278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
const axios = require('axios'); | ||
|
||
exports.handler = function(event, context, callback) { | ||
axios | ||
.get('https://api.tito.io/v3/trace-events/react-rally-2019/releases', { | ||
headers: { | ||
Authorization: 'Token token=' + process.env.TITO_ACCESS_TOKEN, | ||
}, | ||
}) | ||
.then(res => { | ||
res.data.releases = res.data.releases | ||
? res.data.releases.filter(r => !r.secret) | ||
: res.data.data | ||
.filter(r => !r.attributes.secret) | ||
.map(r => ({ | ||
title: r.attributes.title, | ||
description: r.attributes.description, | ||
price: r.attributes.price, | ||
start_at: r.attributes['start-at'], | ||
sold_out: r.attributes['sold-out'], | ||
})); | ||
|
||
delete res.data.data; | ||
|
||
callback(null, { | ||
statusCode: res.status, | ||
headers: res.headers, | ||
body: JSON.stringify(res.data), | ||
}); | ||
}) | ||
.catch(err => { | ||
callback(err, { | ||
statusCode: 500, | ||
body: null, | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build] | ||
command = "npm run build" | ||
functions = ".netlify/functions" |
Oops, something went wrong.