Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
mauran committed Oct 24, 2017
1 parent d120f32 commit e43bde9
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Readme Score](http://readme-score-api.herokuapp.com/score.svg?url=https://github.com/nodes-vapor/gatekeeper)](http://clayallsopp.github.io/readme-score?url=https://github.com/nodes-vapor/gatekeeper)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/nodes-vapor/gatekeeper/master/LICENSE)

Rate Limiter and SSL enforcing middleware.
Rate Limiter middleware.


## 📦 Installation
Expand All @@ -21,33 +21,6 @@ Update your `Package.swift` file.

## Getting started 🚀

Both the rate limiter and SSL-enforcing middleware are easy to configure and get running.


## SSLEnforcer 🔒

`SSLEnforcer` has three configurable fields: the error to be thrown, your `Droplet` and the environments you wish to enforce on. The environments defaults to `[.production]`.
```swift
let drop = Droplet()
// this will only enforce if running in `production` mode.
let enforcer = SSLEnforcer(error: Abort.notFound, drop: drop)
```

If you wish to secure your endpoints during development you can do the following:
```swift
let enforcer = SSLEnforcer(
error: Abort.notFound,
drop: drop,
environments: [
.production,
.development
]
)
```


## RateLimiter ⏱

`RateLimiter` has two configurable fields: the maximum rate and the cache to use. If you don't supply your own cache the limiter will create its own, in-memory cache.

```swift
Expand All @@ -64,7 +37,6 @@ case .hour
case .day
```


## Credits 🏆

This package is developed and maintained by the Vapor team at [Nodes](https://www.nodes.dk).
Expand Down

0 comments on commit e43bde9

Please sign in to comment.