Created
July 10, 2018 14:28
-
-
Save danielkhan/18f201cc9c8a10ebd6e1db3e2f7d7bfb to your computer and use it in GitHub Desktop.
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
const axios = require('axios'); | |
module.exports.handler = async (event, context, callback) => { | |
// Asynchronous HTTP GET | |
// In real projects, you want to add some error handling here. | |
const res = axios.get('https://api.weather.gov/points/39.7456,-97.0892'); | |
const response = { | |
statusCode: 200, | |
body: JSON.stringify(res.data), | |
}; | |
callback(null, response); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment