-
Notifications
You must be signed in to change notification settings - Fork 51
API: remove routes without version prefix #247
Copy link
Copy link
Closed
Labels
EasyGood for NewcomersGood for Newcomers
Description
API routes are duplicated with and without v1 prefix:
pub fn add(prefix: &str, router: Router, tracker: Arc<Tracker>) -> Router {
// Without `v1` prefix.
// We keep the old API endpoints without `v1` prefix for backward compatibility.
// todo: remove when the torrust index backend is using the `v1` prefix.
let router = auth_key::routes::add(prefix, router, tracker.clone());
let router = stats::routes::add(prefix, router, tracker.clone());
let router = whitelist::routes::add(prefix, router, tracker.clone());
let router = torrent::routes::add(prefix, router, tracker.clone());
// With `v1` prefix
let v1_prefix = format!("{prefix}/v1");
let router = auth_key::routes::add(&v1_prefix, router, tracker.clone());
let router = stats::routes::add(&v1_prefix, router, tracker.clone());
let router = whitelist::routes::add(&v1_prefix, router, tracker.clone());
torrent::routes::add(&v1_prefix, router, tracker)
}That was a temporary solution until we changed the backend. The backend was updated so we can remove the routes without prefixes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
EasyGood for NewcomersGood for Newcomers
Type
Projects
Status
No status