CPC G06F 9/548 (2013.01) | 12 Claims |
1. A computer-implemented method for middleware in a web framework, the method comprising:
defining a target object type configured to hold results of a middleware function, by accounting for information produced by processing the middleware function;
enabling a type-safety of the middleware function;
receiving a first object for an application;
performing a process of the middleware function using the first object to generate a process result;
enabling a plurality of middleware functions configured to execute sequentially to each other;
consulting a route table in a web framework;
dispatching a relevant middleware function according to the route table;
based on the process result, generating by the middleware an instance of the middleware wherein the instance of the middleware includes creating a second object of the target object type, wherein the second object is not an altered version of the first object; and
providing the second object from the middleware to a next applicable piece of code in the application;
wherein a route handler function is attached to a route in the application and is configured to provide the second object from the middleware function to the route handler function, and to determine how to handle the second object.
|