generator-express-no-stress
Version:
Awesome APIs with ExpressJS and OpenAPI/Swagger: Features automatic request validation, interactive api doc, and more.
21 lines (16 loc) • 368 B
JavaScript
import l from '../../common/logger';
import db from './examples.db.service';
class ExamplesService {
all() {
l.info(`${this.constructor.name}.all()`);
return db.all();
}
byId(id) {
l.info(`${this.constructor.name}.byId(${id})`);
return db.byId(id);
}
create(name) {
return db.insert(name);
}
}
export default new ExamplesService();