Skip to content

Conversation

Luke-Manyamazi
Copy link

@Luke-Manyamazi Luke-Manyamazi commented Oct 16, 2025

  1. Middleware-custom: Express app with two custom-written middlewares (username and JSON array parser)
  2. Middleware-offTheShelf: Express app replacing JSON parser with Express's built-in middleware
  • Both apps handle POST requests and return authentication and subject info messages

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

I created two Express applications demonstrating middleware usage:

middleware-custom/:
Contains an Express app with two custom-written middlewares:

  • Username middleware that checks for X-Username header
  • JSON parsing and validation middleware that manually handles request body parsing

middleware-offTheShelf/:
Contains an Express app where one middleware is replaced with Express's built-in express.json() middleware:

  • Custom username middleware
  • Off-the-shelf express.json() for JSON parsing
  • Custom validation for array checking

Both applications handle POST requests and return formatted responses showing authentication status and subject information.

Questions

  1. Is the distinction between custom vs off-the-shelf middleware clear enough in my implementation?
  2. Should the error handling be more comprehensive, or is the current simple approach sufficient?
  3. Is the directory structure and separation between the two versions correct for this submission?

  1. Middleware-custom: Express app with two custom-written middlewares (username and JSON array parser)
  2. Middleware-offTheShelf: Express app replacing JSON parser with Express's built-in middleware
- Both apps handle POST requests and return authentication and subject info messages
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Wrong number of parts separated by |s

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

4 similar comments
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Wrong number of parts separated by |s

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Wrong number of parts separated by |s

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Wrong number of parts separated by |s

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Wrong number of parts separated by |s

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@Luke-Manyamazi Luke-Manyamazi changed the title ZA | 25-SDC-July | Luke Manyamazi | Module-Decomposition | Sprint 3 | Middleware Exercises ZA | 25-SDC-July | Luke Manyamazi | Sprint 3 | Middleware Exercises Oct 16, 2025
@Luke-Manyamazi Luke-Manyamazi added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant