MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / main

Function main

examples/seaography_example/graphql/src/main.rs:17–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15
16#[tokio::main]
17async fn main() {
18 dotenv().ok();
19 tracing_subscriber::fmt()
20 .with_max_level(tracing::Level::INFO)
21 .with_test_writer()
22 .init();
23 let database = Database::connect(&*DATABASE_URL)
24 .await
25 .expect("Fail to initialize database connection");
26 let schema =
27 sea_orm_seaography_example::query_root::schema(database, *DEPTH_LIMIT, *COMPLEXITY_LIMIT)
28 .unwrap();
29 let app = Route::new().at(
30 &*ENDPOINT,
31 get(graphql_playground).post(GraphQL::new(schema)),
32 );
33 println!("Visit GraphQL Playground at http://{}", *URL);
34 Server::new(TcpListener::bind(&*URL))
35 .run(app)
36 .await
37 .expect("Fail to start web server");
38}

Callers

nothing calls this directly

Calls 5

unwrapMethod · 0.80
schemaFunction · 0.70
newFunction · 0.50
initMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected