4 stars based on
GoAhead responds to client requests by routing the request to a request handler. The request handler is responsible for generating the response content or redirecting to another more suitable handler.
GoAhead provides a suite of standard handlers for various content types and web frameworks. The standard zu einem handler in optionen supplied with GoAhead are:. You can extend GoAhead zu einem handler in optionen creating your own custom handler to process Http requests and perform zu einem handler in optionen processing you desire.
Once created handlers are configured via routes in the route table. A route contains the full details for how to process a request including the required handler and required authentication. GoAhead matches each route in the route table in-order and selects the first matching route. The route specifies the desired handler for requests matching that route. The last step of selecting a route is calling the candidate handler's optional match callback.
If the match callback returns true, the handler will be selected. If it returns false, the handler and route will be skipped and the route selection process continues. Once the route has been selected, GoAhead invokes the handler service callback to process the request and generate a response.
At this point, request body data will be received and buffered. The handler may choose to not handler the request by returning a zero status code. In that case, zu einem handler in optionen router continues matching routes to find a more suitable route and handler combination.
Handler to serve C functions bound to URLs. The Continue handler is a pseudo handler that performs nothing. It simply continues routing by proceeding to examine the next route in the routing table. The Continue handler is typically used when performing authentication which must be checked before proceeding to serve the request using the appropriate content handler. Here is a route directive that redirects to a login page if not authenticated. If the user is already authenticated, routing continues to examine the next route directive in the route table.
Handler to process file uploads. The upload handler is a special case that filters uploaded files. It is not a "terminal" handler and can be used with another handler to actually handle generating the response.
Standard Handlers GoAhead includes a suite of handlers that process standard content. Continue Handler The Continue handler is a pseudo handler that performs nothing.