Skip to content

Get TypeError: cb is not a function #44

Description

@datapresso

We are using connect-rest via express. We are not using connect directly and we noticed that the error cited in this issue title when we try to callback.

If we try to have "cb" below and it is always undefined and subsequent cb calls will result in the "cb is not a function".

	async function service( request, content, cb ){
	    console.log( 'Received headers:' + JSON.stringify( request.headers ) )
	    console.log( 'Received parameters:' + JSON.stringify( request.parameters ) )
	    console.log( 'Received JSON object:' + JSON.stringify( content ) )
	    console.log( 'cb:' + JSON.stringify(cb) )
	    return 'ok'
	}
	rest.get( [ { path: '/shake', version: '>=2.0.0' }, { path: '/twist', version: '>=2.1.1' } ], service )	

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions