Nihil Prius Modulus

    @trailervote/express-authorization
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.1 • Public • Published

    TrailerVote Express Authorization

    Build Status

    NPM Package Version

    Authorization middleware for TrailerVote ecosystem

    yarn add @trailervote/express-authorization
    import { basic } from '@xpbytes/express-routes-archive'
    
    const root = new RoutesArchive()
    root.register('foo', '/test')
    root.register('bar', (mountedAt: string, arg: any) => `${mountedAt}/test?bar=${arg}`)
    
    // For example you can create these when you mount a new "Router" and pass it along
    // the routes are shared among archives in the chain.
    const up = new RoutesArchive('/level', root)
    up.register('level', '/two')
    up.register('penthouse', (mountedAt: string) => `${mountedAt}/over-9000`)
    
    root.path('bar', 'my-arg')
    // => /test?bar=my-arg
    
    root.url('penthouse', req)
    // => https://test.xpbytes.com/level/over-9000

    You can use SSL_ENABLED to make generated urls https. You can use SERVER_URL to mount the path onto that URL instead of the request hostname.

    Keywords

    none

    Install

    npm i @trailervote/express-authorization

    DownloadsWeekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    13.3 kB

    Total Files

    28

    Last publish

    Collaborators

    • vincentrbbmnd
    • sleeplessbyte
    • thexa4