This commit is contained in:
parent
22f57d1c7e
commit
2f55eec940
26
src/app.rs
26
src/app.rs
@ -105,19 +105,19 @@ pub async fn create_router(
|
||||
|
||||
router_s
|
||||
.route("/graphql", get(not_found).post(graphql_handler))
|
||||
.route_layer(
|
||||
RateLimitLayer::<RealIp>::builder()
|
||||
.with_route(
|
||||
(Method::GET, "/graphql"),
|
||||
Quota::new(Duration::from_millis(100), NonZero::new(10).unwrap()),
|
||||
)
|
||||
.with_route(
|
||||
(Method::POST, "/graphql"),
|
||||
Quota::new(Duration::from_millis(100), NonZero::new(10).unwrap()),
|
||||
)
|
||||
.with_gc_interval(1000)
|
||||
.default_handle_error(),
|
||||
)
|
||||
// .route_layer(
|
||||
// RateLimitLayer::<RealIp>::builder()
|
||||
// .with_route(
|
||||
// (Method::GET, "/graphql"),
|
||||
// Quota::new(Duration::from_millis(100), NonZero::new(10).unwrap()),
|
||||
// )
|
||||
// .with_route(
|
||||
// (Method::POST, "/graphql"),
|
||||
// Quota::new(Duration::from_millis(100), NonZero::new(10).unwrap()),
|
||||
// )
|
||||
// .with_gc_interval(1000)
|
||||
// .default_handle_error(),
|
||||
// )
|
||||
.route_service("/ws", GraphQLSubscription::new(schema))
|
||||
.layer(CorsLayer::permissive())
|
||||
.merge(router)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user