Predefined middleware implementations for logging and JWT authentication. More...
#include "http/Middleware.h"
#include "framework_config.h"
#include "DebugTrace.h"
#include <iostream>
#include "http/HttpResponse.h"
#include "http/JsonResponse.h"
#include "framework/AppContext.h"
Go to the source code of this file.
Variables | |
Middleware | loggingMiddleware |
Part of the PicoFramework HTTP server. This module provides two middleware functions:
authMiddleware
: Checks for a valid JWT in the Authorization header.loggingMiddleware
: Logs the HTTP method and path of incoming requests. Both middleware functions are designed to be used in the HTTP request processing pipeline. If the authentication fails, the authMiddleware
will respond with an HTTP 401 Unauthorized status.Definition in file Middleware.cpp.
Middleware loggingMiddleware |
Logging middleware that prints the HTTP method and path to the console.
Logging middleware that prints the HTTP method and path to the console.
Definition at line 57 of file Middleware.cpp.