mondayu-logger-galtoubul

1.0.5 • Public • Published

workshop-5

Fork this repo

Logger module

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)

  1. npm init
  2. create logger, like this only stdout is needed (logs)
  3. use console options: {'flags': 'a'} to append
  4. export your logger function
  5. update package.json main if your script isn't index.js
  6. npm publish 🚀
    • hint, you'll need to change the package name

Weather App

Create new app for fetching weather service data

  1. Create a GET handler with native http module.
  2. Use open weather api client with this service (sign up required) to get temp at city ID 293397 (tel aviv)
  3. GET ‘localhost:8000’ should return the current weather at Tel Aviv (or some other place) in some format, not important;
  4. check this with your browser or with curl localhost:8000 or with postman
  5. Install your own published logger
  6. Log the fetched temp of every request made
  7. 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.

Readme

Keywords

none

Package Sidebar

Install

npm i mondayu-logger-galtoubul

Weekly Downloads

1

Version

1.0.5

License

ISC

Unpacked Size

3.59 kB

Total Files

6

Last publish

Collaborators

  • galtoubul