{"id":16341574,"url":"https://github.com/psibi/wai-slack-middleware","last_synced_at":"2025-03-23T00:32:31.205Z","repository":{"id":56882357,"uuid":"89151840","full_name":"psibi/wai-slack-middleware","owner":"psibi","description":"A Slack middleware for wai","archived":false,"fork":false,"pushed_at":"2019-01-26T12:11:05.000Z","size":151,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-25T12:20:21.615Z","etag":null,"topics":["haskell","middleware","slack","wai"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/psibi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-23T15:25:50.000Z","updated_at":"2019-04-12T20:43:07.000Z","dependencies_parsed_at":"2022-08-20T23:10:42.478Z","dependency_job_id":null,"html_url":"https://github.com/psibi/wai-slack-middleware","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psibi%2Fwai-slack-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psibi%2Fwai-slack-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psibi%2Fwai-slack-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psibi%2Fwai-slack-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psibi","download_url":"https://codeload.github.com/psibi/wai-slack-middleware/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244257259,"owners_count":20424127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell","middleware","slack","wai"],"created_at":"2024-10-10T23:59:47.925Z","updated_at":"2025-03-23T00:32:30.717Z","avatar_url":"https://github.com/psibi.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wai-slack-middleware\n\n[![Build Status](https://travis-ci.org/psibi/wai-slack-middleware.svg?branch=master)](https://travis-ci.org/psibi/wai-slack-middleware) [![Build Status](https://dev.azure.com/psibi2000/wai-slack-middleware/_apis/build/status/psibi.wai-slack-middleware?branchName=master)](https://dev.azure.com/psibi2000/wai-slack-middleware/_build/latest?definitionId=1?branchName=master)\n\nA Slack middleware for [wai](https://www.stackage.org/package/wai)\nUsed for logging the request information into Slack from a WAI\napplication via middleware.\n\n## Usage:\n\nSettings are controlled via the type `SlackConfig`:\n\n``` haskell\nimport Network.HTTP.Types.Status\nlet slackConfig = SlackConfig {\n    webHookUrl = \"https://hooks.slack.com/services/xxx/xxxxxxxx\",\n    httpManager = appHttpManager foundation,\n    responseFilter = \\resp -\u003e status400 == responseStatus resp,\n    requestFilter = \\_ -\u003e True\n}\n```\n\nThe above configuration will send slack notification for all 400 http\nstatus code.\n\n### Integrating with yesod scaffolding templates\n\nGo to `Application.hs` and change the function `makeApplication` to\nsomething like this:\n\n``` haskell\nmakeApplication :: App -\u003e IO Application\nmakeApplication foundation = do\n  logWare \u003c- makeLogWare foundation\n  let slackConfig = SlackConfig {\n                               webHookUrl = \"https://hooks.slack.com/services/xxxx/xxxxxxx\",\n                               httpManager = appHttpManager foundation,\n                               responseFilter = \\resp -\u003e status400 == responseStatus resp,\n                               requestFilter = \\_ -\u003e True\n                             }\n  -- Create the WAI application and apply middlewares\n  appPlain \u003c- toWaiAppPlain foundation\n  return $ slack slackConfig $ logWare $ defaultMiddlewaresNoLogging appPlain\n```\n\nRef:\n\n* [Slack messages API](https://api.slack.com/docs/messages)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsibi%2Fwai-slack-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsibi%2Fwai-slack-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsibi%2Fwai-slack-middleware/lists"}