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
|
router_s
|
||||||
.route("/graphql", get(not_found).post(graphql_handler))
|
.route("/graphql", get(not_found).post(graphql_handler))
|
||||||
.route_layer(
|
// .route_layer(
|
||||||
RateLimitLayer::<RealIp>::builder()
|
// RateLimitLayer::<RealIp>::builder()
|
||||||
.with_route(
|
// .with_route(
|
||||||
(Method::GET, "/graphql"),
|
// (Method::GET, "/graphql"),
|
||||||
Quota::new(Duration::from_millis(100), NonZero::new(10).unwrap()),
|
// Quota::new(Duration::from_millis(100), NonZero::new(10).unwrap()),
|
||||||
)
|
// )
|
||||||
.with_route(
|
// .with_route(
|
||||||
(Method::POST, "/graphql"),
|
// (Method::POST, "/graphql"),
|
||||||
Quota::new(Duration::from_millis(100), NonZero::new(10).unwrap()),
|
// Quota::new(Duration::from_millis(100), NonZero::new(10).unwrap()),
|
||||||
)
|
// )
|
||||||
.with_gc_interval(1000)
|
// .with_gc_interval(1000)
|
||||||
.default_handle_error(),
|
// .default_handle_error(),
|
||||||
)
|
// )
|
||||||
.route_service("/ws", GraphQLSubscription::new(schema))
|
.route_service("/ws", GraphQLSubscription::new(schema))
|
||||||
.layer(CorsLayer::permissive())
|
.layer(CorsLayer::permissive())
|
||||||
.merge(router)
|
.merge(router)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user