Skip to content

mixing of concerns in readFile #70

@eliasmalik

Description

@eliasmalik

https://github.com/FAC10/week4-jajascript/blob/master/src/handler.js#L10

The readFile function sounds like it should generic function for reading a file, but in fact it is half-way between that and a handler; it understands the res interface as well as knowing that handler.notFound exists. The logic for how to respond to the client should typically live explicitly in the handler, unless there is significant complexity that you are trying to manage.

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