An Actix Web app groups the routes an application can handle. The HTTP server requires an app for initialization, creates one app instance per worker thread, and routes each request through the app to the handler registered for its path and HTTP method. section 3.1.2
Configure an app by connecting request shapes to handlers and application behavior:
- Register a route with a path such as /health. section 3.1.2
- Associate an HTTP method, such as GET, with the route. section 3.1.2
- Forward matching requests to a handler that constructs the HTTP response. section 3.1.2
- Register API routes for creating courses, listing a tutor’s courses, and retrieving course details. section 3.2.1
- Let handlers parse parameters, read or write the in-memory store, and return successful or error responses. section 3.2.1
Health-check application
A browser sends GET /health to the listening Actix server. The server selects the app’s /health route, the app dispatches to health_check_handler(), and the handler returns an HTTP response containing the service status. The same application structure scales to the tutor-service routes, whose handlers use an in-memory course store. section 3.1.2 section 3.2.1
Trace how the HTTP server, app, routes, and handlers cooperate during request processing. section 3.1.2
