not-decky-store/src/not_decky/index.rs

37 lines
1.3 KiB
Rust
Raw Normal View History

use actix_web::{get, HttpResponse, Responder, HttpRequest, Either};
2022-12-08 02:30:10 +00:00
#[get("/")]
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
}