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

Make SubmissionsMiddleware ServiceType compliant to add middleware in config as the rest of vapor's available middleware (coding style more than a real improvement) #49

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Magiguigui
Copy link

Self-describing (and from #48)

Copy link
Contributor

@siemensikkema siemensikkema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better, thanks 🙂 Just a couple of nitpicks, but otherwise 👍


/// See `ServiceType`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use spaces here instead of tabs :)

README.md Outdated

"Submissions" comes with a light-weight provider that we'll need to register in the `configure` function in our `configure.swift` file:

```swift
try services.register(SubmissionsProvider())
```

It also include a middleware you have to register in your `MiddlewareConfig` :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*includes

@Magiguigui
Copy link
Author

I took care to correct from your review and improve a little bit the doc. Also add a commit of code (Wasn't sufficient for vapor to make Middleware ServiceType compliant) should really work now.

@@ -7,7 +7,7 @@ import Vapor
/// up the responder chain.
public final class SubmissionsMiddleware: Middleware, ServiceType {

/// See `ServiceType`.
/// See `ServiceType`.
public static func makeService(for container: Container) throws -> SubmissionsMiddleware {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are tabs, please use spaces 🙂 (in the whole function)

@@ -8,6 +8,7 @@ public final class SubmissionsProvider: Provider {

/// See `Provider`
public func register(_ services: inout Services) throws {
services.register(SubmissionsMiddleware.self)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more tabs that should be spaces 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants