Skip to content

Commit

Permalink
feat: use default webhook endpoint (#537)
Browse files Browse the repository at this point in the history
  • Loading branch information
thorseraq authored Sep 14, 2023
1 parent a0a23ff commit 957c698
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion apps/keck/src/server/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl Context {
Context {
channel: RwLock::new(HashMap::new()),
storage,
webhook: Arc::default(),
webhook: Arc::new(RwLock::new(dotenvy::var("HOOK_ENDPOINT").unwrap_or_default())),
}
}

Expand Down
3 changes: 0 additions & 3 deletions apps/keck/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,11 @@ pub async fn start_server() {
.allow_origin(origins)
.allow_headers(Any);

let hook_endpoint = Arc::new(RwLock::new(dotenvy::var("HOOK_ENDPOINT").unwrap_or_default()));

let context = Arc::new(Context::new(None).await);

let app = sync::sync_handler(api::api_handler(Router::new()))
.layer(cors)
.layer(Extension(context.clone()))
.layer(Extension(hook_endpoint));

let addr = SocketAddr::from((
[0, 0, 0, 0],
Expand Down

0 comments on commit 957c698

Please sign in to comment.