contributte / api

🆖 Powerful, documented, validated, built-in API to Nette Framework. (@nette)
https://contributte.org/packages/contributte/api.html
MIT License
10 stars 2 forks source link

Routing: simplify routing mask #9

Closed f3l1x closed 7 years ago

f3l1x commented 7 years ago
middleware.api:
    class: Contributte\Api\Bridges\Middlewares\ApiDataMiddleware([
        Contributte\Api\Bridges\Middlewares\ApiRouter("^/franta/{api}{?format:\\.json|.debug}$"),
        Contributte\Api\Bridges\Middlewares\ApiContentNegotiation([
            Contributte\Api\Bridges\Middlewares\Negotiation\UrlNegotiator([
                "json": Contributte\Api\Bridges\Middlewares\Negotiation\Transformer\JsonTransformer(),
                "debug": Contributte\Api\Bridges\Tracy\Negotiation\Transformer\DebugTransformer(),
                "*": Contributte\Api\Bridges\Middlewares\Negotiation\Transformer\JsonTransformer()
            ])
        ]),
        Contributte\Api\Bridges\Middlewares\ApiEmitter()
    ])

to

middleware.api:
    class: Contributte\Api\Bridges\Middlewares\ApiDataMiddleware([
        Contributte\Api\Bridges\Middlewares\ApiPrefix("/franta"),
        Contributte\Api\Bridges\Middlewares\ApiContentNegotiation([
            Contributte\Api\Bridges\Middlewares\Negotiation\UrlNegotiator([
                "json": Contributte\Api\Bridges\Middlewares\Negotiation\Transformer\JsonTransformer(),
                "debug": Contributte\Api\Bridges\Tracy\Negotiation\Transformer\DebugTransformer(),
                "*": Contributte\Api\Bridges\Middlewares\Negotiation\Transformer\JsonTransformer()
            ])
        ]),
        Contributte\Api\Bridges\Middlewares\ApiEmitter()
    ])