Open phenax opened 6 years ago
Branch: dev_resources_api
An alternative to APIRouter.
API Possibilities
<Resource name='posts'> <Action path='/' action={listPost} /> <Action path='/add' method='POST' action={createPost} /> </Resource>
OR
// Class declaration class ControllerClass extends BaseController { listPost() { /* ... */ } createPost() { /* ... */ } }
// Usage <Resource name='posts' controller={ControllerClass}> <Action path='/' action='listPost' /> <Action path='/add' method='POST' action='createPost' /> </Resource>
Declaring stuff with decorators
// Class declaration @resource('post') class ControllerClass extends BaseController { @action('/') listPost() { /* ... */ } @action('/add', 'POST') createPost() { /* ... */ } }
// Usage <Resource controller={ControllerClass} />
Branch: dev_resources_api
An alternative to APIRouter.
API Possibilities
OR
OR
Declaring stuff with decorators