Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pauloportugal/express-weather-service
An asynchronous Express Weather app
https://github.com/pauloportugal/express-weather-service
asynchronous expressjs nodejs webapp
Last synced: 23 days ago
JSON representation
An asynchronous Express Weather app
- Host: GitHub
- URL: https://github.com/pauloportugal/express-weather-service
- Owner: PauloPortugal
- License: gpl-2.0
- Created: 2020-02-02T10:38:09.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T22:59:33.000Z (almost 2 years ago)
- Last Synced: 2024-10-02T09:20:21.760Z (about 1 month ago)
- Topics: asynchronous, expressjs, nodejs, webapp
- Language: JavaScript
- Size: 274 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# An Express.js Weather App
An event-driven asynchronous [Express.js](http://expressjs.com/) Weather app. This is the web application equivalent of [Node.js Weather App](https://github.com/PauloPortugal/nodejs-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* Uses [mapbox.com](mapbox.com) for forward geocoding
* Uses [darksky.net](darksky.net) to return the weather forecast for a given town/place.
* Uses [npm hbs](https://www.npmjs.com/package/hbs) as the Express.js view engine for [handlebars.js](https://handlebarsjs.com/)
* Uses the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to make an async call## Setup
* Create a (free) account with [mapbox.com](mapbox.com) and [darksky.net](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="" npm run start# On nodemon mode
DARKSKY_TOKEN="your-darksky-token" MAPBOX_TOKEN="" npm run dev
```
2. 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
git push heroku master
```