Skip to content

Custom Matcher

Pre-release
Pre-release
Compare
Choose a tag to compare
@darkcl darkcl released this 19 Mar 15:12

You can override default matcher function with addMatcher(to:)

jellyfish.addMatcher(to: "/message") { req in
  let str: String = "This is a message"
  return APIResponse(headers: ["Server": "Custom Handler"], responseCode: 200, body: str.data(using: .utf8)!)
}