import request from 'superagent'

const weatherAPI = 'http://api.openweathermap.org/data/2.5/forecast?id=524901&APPID='

const mapKey = 'fc04e2e516b1de4348fb0323f981a1d9'

module.exports = {
  getWeather
}

function getWeather() {
  request
  .get(weatherAPI + mapKey)
  .set('Accept', 'application/json')
  .end((err, res) => {
    if(err) {
    callback(err.message)
      return
    }
    const weather = res.body
    callback(null, weather)
  })
}

import request from 'superagent'

module.exports = {
  getWeather
}

function getWeather() {
  request
  .get(`http://api.openweathermap.org/data/2.5/weather?=${city}&units=metric&APPID=fc04e2e516b1de4348fb0323f981a1d9`)
  .set('Accept', 'application/json')
  .end((err, res) => {
    if(err) {
    callback(err.message)
      return
    }
    const weather = res.body
    callback(null, weather)
  })
}

Rework api