Skip to content

Instantly share code, notes, and snippets.

@danielkhan
Last active July 12, 2018 15:39
Show Gist options
  • Save danielkhan/1e6adaa78af685f901aad5575ece5149 to your computer and use it in GitHub Desktop.
Save danielkhan/1e6adaa78af685f901aad5575ece5149 to your computer and use it in GitHub Desktop.
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 = await 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