npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cuser/express-middleware-rest

v0.0.36

Published

<p align="center"> <a href="./"><img width="250" src="https://raw.githubusercontent.com/rubeniskov/cuser/master/docs/logo.svg" alt="cuser logo" /></a> </p>

Downloads

55

Readme

@cuser/express-middleware-rest

Status

codecov npm

curl -X POST \
  http://localhost:8080/v1/message \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "topicId": "RANDOM_TOPIC_CID",
    "content": {
        "data": "Message content"
    },
    "user": {
        "peerId": "RANDOM_PEER_ID",
        "username": "exampleuser",
        "avatar": "https://www.w3schools.com/howto/img_avatar.png"
    }
}'
curl -X PATCH \
  http://localhost:8080/v1/message \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "topicId": "RANDOM_TOPIC_CID",
    "messageId": "message_id",
    "content": {
        "data": "Message content"
    },
    "user": {
        "peerId": "RANDOM_PEER_ID",
        "username": "exampleuser",
        "avatar": "https://www.w3schools.com/howto/img_avatar.png"
    }
}'
curl -X DELETE \
  http://localhost:8080/v1/message \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "topicId": "RANDOM_TOPIC_CID",
    "messageId": "message_id",
    "user": {
        "peerId": "RANDOM_PEER_ID",
        "username": "exampleuser",
        "avatar": "https://www.w3schools.com/howto/img_avatar.png"
    }
}'

@cuser/express-middleware-rest

Index

Variables

Functions

Object literals

Variables

Router

Const Router: any = require('router')

Defined in express-middleware-rest/middleware.js:4

Defined in express-middleware-rest/publisher.js:8

Defined in express-middleware-rest/reader.js:6


authGuard

authGuard: any

Defined in express-middleware-rest/publisher.js:10


bodyParser

Const bodyParser: any = require('body-parser')

Defined in express-middleware-rest/middleware.js:6


createPublisher

Const createPublisher: createPublisher = require('@cuser/publisher')

Defined in express-middleware-rest/publisher.js:9


createReader

Const createReader: createReader = require('@cuser/reader')

Defined in express-middleware-rest/reader.js:7


debug

Const debug: Debugger = require('debug')('cuser:server:rest')

Defined in express-middleware-rest/middleware.js:5


defaultWrapper

Const defaultWrapper: wrapper = require('./wrapper')

Defined in express-middleware-rest/publisher.js:11

Defined in express-middleware-rest/reader.js:8


description

description: string

Defined in express-middleware-rest/middleware.js:7


name

name: string

Defined in express-middleware-rest/middleware.js:7


version

version: string

Defined in express-middleware-rest/middleware.js:7

Functions

createRestMiddleware

ConstcreateRestMiddleware(core: CuserCore, auth: CuserAuth, opts: CuserExpressMiddlewareRestOptions): any

Defined in express-middleware-rest/middleware.js:33

Parameters:

Name | Type | ------ | ------ | core | CuserCore | auth | CuserAuth | opts | CuserExpressMiddlewareRestOptions |

Returns: any


createRestPublisherMiddleware

ConstcreateRestPublisherMiddleware(core: CuserCore, auth: CuserAuth, opts?: any): any

Defined in express-middleware-rest/publisher.js:25

Parameters:

Name | Type | Default value | ------ | ------ | ------ | core | CuserCore | - | auth | CuserAuth | - | opts | any | {} |

Returns: any


createRestReaderMiddleware

ConstcreateRestReaderMiddleware(core: CuserCore, opts?: CuserExpressMiddlewareRestReaderOptions & CuserReaderOptions): any

Defined in express-middleware-rest/reader.js:21

Parameters:

Name | Type | Default value | ------ | ------ | ------ | core | CuserCore | - | opts | CuserExpressMiddlewareRestReaderOptions & CuserReaderOptions | {} |

Returns: any


parseOpts

ConstparseOpts(opts: any): any

Defined in express-middleware-rest/middleware.js:17

Parameters:

Name | Type | ------ | ------ | opts | any |

Returns: any


swaggerRouter

ConstswaggerRouter(opts: any): any

Defined in express-middleware-rest/swagger.js:6

Parameters:

Name | Type | ------ | ------ | opts | any |

Returns: any


wrapper

Constwrapper(wrappedHandler: Function): any

Defined in express-middleware-rest/wrapper.js:14

Parameters:

Name | Type | ------ | ------ | wrappedHandler | Function |

Returns: any

Object literals

defaults

Const defaults: object

Defined in express-middleware-rest/middleware.js:10

Properties:

Name | Type | Value | ------ | ------ | ------ | mount | string | "/rest" | publisher | boolean | true | reader | boolean | false | ui | boolean | process.env.NODE_ENV !== 'production' |