jeremydaly / jeremydaly/lambda-api

Middleware After Routes

Open
#142 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.5k
Forks
127
Avg merge
31m
Merged PRs (30d)
2

Description

Is it possible to trigger additional, global middle-ware after routes have been run? For instance, if I wanted to inspect all response bodies for certain properties, and alter the response prior to returning according to some logic. Or if I have a number of routes that call to a DB that may return no records, and if any route logic returns null I want to change the status code to 404 and return 'Not Found'.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or entry point is named. Start by tracing how lambda-api runs middleware and routes, then determine where a post-route hook could observe or alter responses. Done means the intended global post-route behavior and its handling of null results are specified and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript, node.js
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.