Contents

ml-archive/n-meta

This package enforces clients to send a specific header in all requests:

πŸ“¦ Installation

Update your Package.swift file.

    ...
    dependencies: [
        ...
        .package(url: "https://github.com/nodes-vapor/n-meta.git", from: "4.0.0")
    ],
    targets: [
        .target(
            name: "App",
            dependencies: [
                ...
                .product(name: "NMeta", package: "n-meta"),
            ]
        )
        ...

Getting started πŸš€

Configure NMeta as per your needs, for example:

app.nMeta = .init(exceptPath: ["/admin"])

Next, add the middleware directly to your routes (e.g. in routes.swift):

app.grouped(NMetaMiddleware()).get("hello") { req in
    "Hello, world!"
}

or add the middleware globally (e.g. in configure.swift) which will add it to all routes:

app.middlewares.use(NMetaMiddleware())

πŸ† Credits

This package is developed and maintained by the Vapor team at Nodes.

πŸ“„ License

This package is open-sourced software licensed under the MIT license

Package Metadata

Repository: ml-archive/n-meta

Default branch: master

README: README.md