UNPKG

@adonisjs-community/girouette

Version:

An AdonisJS package allowing decorators-based routing.

20 lines (19 loc) 589 B
/** * The `@ApiOnly` decorator removes the routes which aren't needed for an API resource. * (i.e. `create`, `edit`) * * @example * ```ts * @Resource('/posts', 'blog.posts') * @ApiOnly() * export default class PostsController { * // Generates routes: * // GET /posts (blog.posts.index) * // POST /posts (blog.posts.store) * // GET /posts/:id (blog.posts.show) * // PUT /posts/:id (blog.posts.update) * // DELETE /posts/:id (blog.posts.destroy) * } * ``` */ export declare const ApiOnly: () => (target: any) => void;