Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
madsodgaard committed Mar 19, 2020
1 parent 9a4fa40 commit c090d57
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,24 @@ func configure(_ app: Application) throws {
}
```

## Usage
### Sending a SMS
You can use the API client either through `Application` or `Request`

### Application
#### Application
```swift
import GatewayAPI

func configure(_ app: Application) throws {
app.gatewayAPI.configuration = .environment

_ = app.gatewayAPI.client.send("Text message": to: ["4510203040"], from: "Mads")
}
```

### Request (inside controller)
#### Request (inside controller)
```swift
import GatewayAPI

func sendSMS(req: Request) throws -> EventLoopFuture<Void> {
return req.gatewayAPI.send("Text message": to: ["4510203040"], from: "Mads").transform(to: ())
}
Expand Down

0 comments on commit c090d57

Please sign in to comment.