Skip to content

Doc on how to write tests #555

Discussion options

You must be logged in to vote

Here is the modified app fn after I added the pgpool. I added "async" so that the pool would work. But this will give me an error for the line .serve(app().into_make_service())

no method named into_make_service found for opaque type impl Future in the current scope
method not found in impl Future

#[allow(dead_code)]
async fn app() -> Router {
    dotenv().ok();
    let database_url = env::var("DATABASE_URL").expect("DATABASE_URL is not set in .env file");
    let db_pool = PgPool::connect(&database_url).await.unwrap();
    let shared_state = Arc::new(AppState {
        health_check_response: "I'm good.  You've already asked me ".to_string(),
        visit_count: Mutex::new(0),
        d…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@davidpdrsn
Comment options

@SylvainMartel
Comment options

@davidpdrsn
Comment options

Answer selected by davidpdrsn
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants