const url = require('url');
const got = require("got");
module.exports.endpoint = async function(req, res)
{
const { zipCode } = url.parse(req.url, true).query
const URL = `http://api.openweathermap.org/data/2.5/weather?zip=${zipCode}&appid=${process.env.OPEN_WEATHER_APP_KEY}`;
const data = (await got(URL)).body;
res.end(data);
}