Fork this repo
Create logger module as a new package that accepts a log and appends the log to a log file (creates one if it doesn’t exist)
- npm init
- create logger, like this only stdout is needed (logs)
- use console options: {'flags': 'a'} to append
- export your logger function
- update package.json main if your script isn't index.js
- npm publish 🚀
- hint, you'll need to change the package name
Create new app for fetching weather service data
- Create a GET handler with native http module.
- Use open weather api client with this service (sign up required) to get temp at city ID 293397 (tel aviv)
- GET ‘localhost:8000’ should return the current weather at Tel Aviv (or some other place) in some format, not important;
- check this with your browser or with
curl localhost:8000
or with postman - Install your own published logger
- Log the fetched temp of every request made
- Bonuses:
- Link your logger to your local package
- (only after finishing): return data in a 1, nice html format
- Accept query params for which city id or location to check the weather for.