express-weather-service

An asynchronous Express Weather app

GPL-2.0 License

Stars
0
Committers
1

An Express.js Weather App

An event-driven asynchronous Express.js Weather app. This is the web application equivalent of Node.js Weather App.

This is part of Andrew Mead's (mead.io) "The Complete Node.js Developer Course".

Goal

Return a weather forecast based on user's input location

Setup

  • Create a (free) account with mapbox.com and darksky.net and provide the keys/tokens through an environment variable.
  • Run git update-index --assume-unchanged config/tokens.json to avoid commiting the tokens to a remote repo

How to execute

  1. From the command line:
# On normal node mode
DARKSKY_TOKEN="your-darksky-token" MAPBOX_TOKEN="<your-mapbox-token>"  npm run start

# On nodemon mode
DARKSKY_TOKEN="your-darksky-token" MAPBOX_TOKEN="<your-mapbox-token>"  npm run dev
  1. Navigate to the browser:
# Locally
http://localhost:3000

# Heroku
https://pmonteiro-weather-service.herokuapp.com/

Heroku integration

Useful commands:

   heroku login
   heroku keys:add
   heroku create <UNIQUE_NAME>
   git push heroku master