lexa-framework 0.2.8

Framework web backend personnel par dessus Axum.
Documentation
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
// ┃ Copyright: (c) 2023, Mike 'PhiSyX' S. (https://github.com/PhiSyX)         ┃
// ┃ SPDX-License-Identifier: MPL-2.0                                          ┃
// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
// ┃                                                                           ┃
// ┃  This Source Code Form is subject to the terms of the Mozilla Public      ┃
// ┃  License, v. 2.0. If a copy of the MPL was not distributed with this      ┃
// ┃  file, You can obtain one at https://mozilla.org/MPL/2.0/.                ┃
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

mod server_settings_site;

use std::process;

use console::style;
use server_settings_site::applications::Application;

#[tokio::main]
async fn main() -> impl process::Termination {
	let application = match Application::new(
		env!("CARGO_BIN_NAME"),
		env!("CARGO_PKG_VERSION"),
		format!(
			"{}/examples/server_settings_site",
			env!("CARGO_MANIFEST_DIR")
		),
	)
	.await
	{
		| Ok(application) => application.setup(),
		| Err(err) => return exit(err),
	};

	if let Err(err) = application.run().await {
		return exit(err);
	}

	process::ExitCode::SUCCESS
}

fn exit(err: impl std::error::Error) -> process::ExitCode {
	eprintln!(
		"{} {}: {}",
		style("error").red(),
		style(env!("CARGO_BIN_NAME")).red(),
		err,
	);
	process::ExitCode::FAILURE
}