2024-05-11 04:25:49 +01:00
|
|
|
use actix_web::{get, HttpResponse, Responder, HttpRequest, Either};
|
2022-12-08 02:30:10 +00:00
|
|
|
|
|
|
|
#[get("/")]
|
2024-05-11 04:25:49 +01:00
|
|
|
pub async fn decky_index(req: HttpRequest) -> impl Responder {
|
|
|
|
if req.headers().contains_key("X-Decky-Version") {
|
|
|
|
// a real store request
|
|
|
|
Either::Left(actix_web::web::Redirect::to("/plugins").temporary())
|
|
|
|
} else {
|
|
|
|
Either::Right(HttpResponse::Ok()
|
|
|
|
.insert_header(("Content-Type", "text/html"))
|
|
|
|
.body(r##"
|
|
|
|
<!DOCTYTPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<title>Not Decky Store</title>
|
|
|
|
<meta name="title" content="Not Decky Store" />
|
|
|
|
<meta name="description" content="Alternate store implementation for Decky Loader" />
|
|
|
|
|
|
|
|
<!-- Open Graph -->
|
|
|
|
<meta property="og:type" content="website" />
|
|
|
|
<meta property="og:url" content="https://git.ngni.us/NG-SD-Plugins/not-decky-store" />
|
|
|
|
<meta property="og:title" content="Not Decky Store" />
|
|
|
|
<meta property="og:description" content="Alternate store implementation for Decky Loader" />
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1>Not Decky Store</h1>
|
|
|
|
<h2>An alternate store implementation for Decky Loader</h2>
|
|
|
|
<h3>Maybe one day this page will display plugin in a human readable way...</h3>
|
|
|
|
<br/>
|
|
|
|
<a href="/plugins">plugins</a>
|
|
|
|
| <a href="https://git.ngni.us/NG-SD-Plugins/not-decky-store">code</a>
|
|
|
|
| GPL v3.0
|
|
|
|
</body>
|
|
|
|
</html>"##))
|
|
|
|
}
|
2022-12-08 02:30:10 +00:00
|
|
|
}
|