While planning is helpful for initial application design, Sisk’s architecture makes it easy to extend APIs by simply adding new routes as needed. By starting with a well-structured application, new routes can be seamlessly integrated with minimal disruption, ensuring that the code remains easy to understand. This is a crucial feature that allows your applications and APIs to adapt to new user demands.
Routes, Requests, and Responses
Routes in Sisk are not limited to being static. They can be dynamic and rely on parameters set by other parts of the application or user inputs. For example, if you are using Sisk to provide access to an online catalog, you can create a route that starts at the root of the catalog and dynamically adds routes to specific pages within the catalog.
Every route in Sisk has two key elements: requests and responses. Requests are received by Sisk, with their URLs matched to the router. Additionally, payloads are attached to the request object, ready for processing by the code associated with the route. Query strings are not matched separately, as they are considered part of the request payload.