-
Notifications
You must be signed in to change notification settings - Fork 0
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
Franco Méndez
committed
Oct 21, 2019
1 parent
75c3f05
commit ab11e95
Showing
5 changed files
with
114 additions
and
82 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
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
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
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 |
---|---|---|
@@ -1,20 +1,21 @@ | ||
const {parallelScan} = require('@shelf/dynamodb-parallel-scan'); | ||
const { parallelScan } = require('@shelf/dynamodb-parallel-scan'); | ||
|
||
async function getTrips(){ | ||
let params = { | ||
TableName: process.env.dynamodb_table_name, | ||
ProjectionExpression: "trip_id, etd, driver_id, available_seats, route_points" | ||
}; | ||
let data = await parallelScan(params, {concurrency: 1000}); | ||
return data; | ||
async function getTrips() { | ||
let params = { | ||
TableName: process.env.dynamodb_table_name, | ||
ProjectionExpression: | ||
'trip_id, etd, driver_id, available_seats, route_points' | ||
}; | ||
let data = await parallelScan(params, { concurrency: 1000 }); | ||
return data; | ||
} | ||
|
||
exports.handler = async (event) => { | ||
let query = await getTrips(); | ||
const response = { | ||
statusCode: 200, | ||
headers: {'Access-Control-Allow-Origin': '*'}, | ||
body: JSON.stringify(query) | ||
}; | ||
return response; | ||
exports.handler = async event => { | ||
let query = await getTrips(); | ||
const response = { | ||
statusCode: 200, | ||
headers: { 'Access-Control-Allow-Origin': '*' }, | ||
body: JSON.stringify(query) | ||
}; | ||
return response; | ||
}; |
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