An ergonomic and elegant framework for creating Gemini servers and SCGI apps without needless bloat
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1005 B

use anyhow::*;
use log::LevelFilter;
use northstar::{
GEMINI_PORT,
Request,
Response,
Server,
user_management::UserManagementRoutes,
};
#[tokio::main]
async fn main() -> Result<()> {
env_logger::builder()
.filter_module("northstar", LevelFilter::Debug)
.init();
Server::bind(("0.0.0.0", GEMINI_PORT))
.add_route("/", handle_request)
.add_um_routes::<String>("/")
.serve()
.await
}
/// An ultra-simple demonstration of simple authentication.
///
/// If the user attempts to connect, they will be prompted to create a client certificate.
/// Once they've made one, they'll be given the opportunity to create an account by
/// selecting a username. They'll then get a message confirming their account creation.
/// Any time this user visits the site in the future, they'll get a personalized welcome
/// message.
async fn handle_request(_request: Request) -> Result<Response> {
Ok(Response::success_plain("Base handler"))
}