Skip to content

Keep API.js more generic #48

Description

@LaLeonie

It's great that you modularised your API call in a separate file. However, the point of modularisation is that you create functions that can be reused multiple times. At the moment, the function in your API call is very much tailored to your weather API, so you wouldn't be able to use it with a call to another API.

I would suggest that you make the api.js function more generic i.e. reusable by moving the logic specific to the weather API into the callback definition in handle input in handlers.js

You also need to uncomment the response.writeHead part in this function as you’re currently not returning a status code in a success case

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions