pages/apidirectory, are processed by a defined set of middleware, then if successfully forwarded to a given handler.
app/handlersto effectively be invokable single function controllers.
processfunction to chain a list of middleware, authentication validation, and context injection before hitting in the handler. Providing a higher degree of flexible testability.
pages/api/consensus/topic/[id].jsprovides additional insight into how to wrap a single route to manage a given resource consisting of different handlers.