Skip to content

Commit

Permalink
Once via structopt, now direct clap.
Browse files Browse the repository at this point in the history
  • Loading branch information
futursolo committed Apr 1, 2022
1 parent 7065ac9 commit 95889da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/ssr_router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ wasm-logger = "0.2"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1.15.0", features = ["full"] }
warp = "0.3"
structopt = "0.3"
env_logger = "0.9"
num_cpus = "1.13"
tokio-util = { version = "0.7", features = ["rt"] }
once_cell = "1.5"
clap = { version = "3.1.7", features = ["derive"] }
6 changes: 3 additions & 3 deletions examples/ssr_router/src/bin/ssr_router_server.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
use clap::Parser;
use function_router::{ServerApp, ServerAppProps};
use once_cell::sync::Lazy;
use std::collections::HashMap;
use std::path::PathBuf;
use structopt::StructOpt;
use tokio_util::task::LocalPoolHandle;
use warp::Filter;

// We spawn a local pool that is as big as the number of cpu threads.
static LOCAL_POOL: Lazy<LocalPoolHandle> = Lazy::new(|| LocalPoolHandle::new(num_cpus::get()));

/// A basic example
#[derive(StructOpt, Debug)]
#[derive(Parser, Debug)]
struct Opt {
/// the "dist" created by trunk directory to be served for hydration.
#[structopt(short, long, parse(from_os_str))]
Expand Down Expand Up @@ -43,7 +43,7 @@ async fn render(index_html_s: &str, url: &str, queries: HashMap<String, String>)
async fn main() {
env_logger::init();

let opts = Opt::from_args();
let opts = Opt::parse();

let index_html_s = tokio::fs::read_to_string(opts.dir.join("index.html"))
.await
Expand Down

0 comments on commit 95889da

Please sign in to comment.