Plugins
Defining a plugin
TODO
import { BookController } from './controllers/BookController';
import { BookCollectionController } from './controllers/BookCollectionController';
import { Book } from './entities/Book';
import { Plugin, getRepository } from '@puro/core';
export class BookPlugin extends Plugin {
protected getServices() {
return {
bookRepository: async () => getRepository(Book)
};
}
protected getRoutes() {
return [
{ path: '/books/:bookId', controller: BookController },
{ path: '/books', controller: BookCollectionController }
];
}
}
Last updated
Was this helpful?