-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(codeberg): introduce codeberg api endpoint
The `/v1/codeberg` API endpoint supports `codeberg.org`, which runs Forgejo (a Gitea soft-fork), so it simply redirects all requests to `/v1/gitea/codeberg.org`. Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-FileCopyrightText: 2023 Gergely Nagy | ||
// SPDX-FileContributor: Gergely Nagy | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
use axum::{ | ||
extract::Path, | ||
response::{IntoResponse, Redirect}, | ||
}; | ||
|
||
#[allow(unused)] | ||
use log::{debug, error, info, trace, warn}; | ||
|
||
pub async fn codeberg_redirect(Path(url): Path<String>) -> impl IntoResponse { | ||
let target = format!("/v1/gitea/codeberg.org/{}", url); | ||
trace!("{target:#?}"); | ||
Redirect::to(&target).into_response() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters