Organize API endpoints hierarchically by resource type and use appropriate HTTP methods based on operation semantics. Group related operations under resource-based paths, use debug prefixes for administrative endpoints, and select HTTP methods that match the operation's behavior:
Organize API endpoints hierarchically by resource type and use appropriate HTTP methods based on operation semantics. Group related operations under resource-based paths, use debug prefixes for administrative endpoints, and select HTTP methods that match the operation’s behavior:
/v1/resource/sub-resource
/debug/v1/
Example:
Router::new()
// Resource endpoints
.route("/v1/lfc/prewarm", get(get_prewarm_status))
.route("/v1/lfc/prewarm", post(start_prewarm))
.route("/v1/lfc/offload", get(get_offload_status))
.route("/v1/lfc/offload", post(start_offload))
// Debug endpoints
.route("/debug/v1/feature_flag", put(override_flag))
Enter the URL of a public GitHub repository