Skip to content

Ability to have specific middleware for specific resource controllers#16

Closed
iSimar wants to merge 2 commits intodevelopit:masterfrom
iSimar:master
Closed

Ability to have specific middleware for specific resource controllers#16
iSimar wants to merge 2 commits intodevelopit:masterfrom
iSimar:master

Conversation

@iSimar
Copy link

@iSimar iSimar commented Jun 29, 2018

Overview

Currently all the keys are just functions (ie. create, read). You can have a case where auth is required for creating a resource but not reading it. You can't add middleware to specific controllers. The old usage would still work, where create is a function.

Example:

        create: {
		middleware: [],
		controller({ body }, res) {
			body.id = facets.length.toString(36);
			facets.push(body);
			res.json(body);
		}
	},

@developit
Copy link
Owner

Values can already be arrays of middlwares:

#11 (comment)

@iSimar iSimar closed this Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants