Commit 5e85e049 authored by Katharina Fey's avatar Katharina Fey 🏴
Browse files

Hooking up server code

parent 26de62ca
use clap::{App, AppSettings, Arg, SubCommand};
use forge::{hash, secret, setup};
use forge::{hash, secret, server, setup};
fn main() {
let app = App::new("forge-cli")
......@@ -51,12 +51,18 @@ fn main() {
.long("file")
.help("Provide a file name"),
),
)
.subcommand(
SubCommand::with_name("run")
.about("Run the forge server")
.version(server::VERSION),
);
match app.get_matches().subcommand() {
("hash", Some(m)) => hash::run(m),
("encrypt", Some(m)) => secret::run(m),
("setup", Some(m)) => setup::run(m),
("run", _) => server::run(),
_ => unreachable!(),
}
}
......@@ -5,6 +5,9 @@ mod utils {
pub use crate::*;
}
/// The module version
pub const VERSION: &'static str = "0.1.0";
#[derive(Clone)]
struct Params {
bind: String,
......@@ -50,7 +53,7 @@ fn index(state: web::Data<Params>, req: HttpRequest) -> HttpResponse {
}
}
pub fn main() {
pub fn run() {
let params = Params::new();
let bind = params.bind.clone();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment