feat: nostr domain hosting
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-04-03 12:56:20 +01:00
parent a4850b4e06
commit c432f603ec
32 changed files with 724 additions and 70 deletions

7
lnvps_common/Cargo.toml Normal file
View File

@ -0,0 +1,7 @@
[package]
name = "lnvps_common"
version = "0.1.0"
edition = "2024"
[dependencies]
rocket.workspace = true

34
lnvps_common/src/cors.rs Normal file
View File

@ -0,0 +1,34 @@
use rocket::fairing::{Fairing, Info, Kind};
use rocket::http::Header;
use rocket::route::{Handler, Outcome};
use rocket::{Data, Request, Response};
#[derive(Clone)]
pub struct CORS;
#[rocket::async_trait]
impl Fairing for CORS {
fn info(&self) -> Info {
Info {
name: "CORS headers",
kind: Kind::Response,
}
}
async fn on_response<'r>(&self, _req: &'r Request<'_>, response: &mut Response<'r>) {
response.set_header(Header::new("Access-Control-Allow-Origin", "*"));
response.set_header(Header::new(
"Access-Control-Allow-Methods",
"PUT, GET, HEAD, DELETE, OPTIONS, POST, PATCH",
));
response.set_header(Header::new("Access-Control-Allow-Headers", "*"));
response.set_header(Header::new("Access-Control-Allow-Credentials", "true"));
}
}
#[rocket::async_trait]
impl Handler for CORS {
async fn handle<'r>(&self, _request: &'r Request<'_>, _data: Data<'r>) -> Outcome<'r> {
Outcome::Success(Response::new())
}
}

2
lnvps_common/src/lib.rs Normal file
View File

@ -0,0 +1,2 @@
pub mod cors;
pub use cors::*;