summaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
Diffstat (limited to 'src/services')
-rw-r--r--src/services/accounts.service.ts10
-rw-r--r--src/services/index.ts2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/services/accounts.service.ts b/src/services/accounts.service.ts
new file mode 100644
index 0000000..cf22a9b
--- /dev/null
+++ b/src/services/accounts.service.ts
@@ -0,0 +1,10 @@
+import { Application } from '@feathersjs/express';
+import service from 'feathers-mongoose';
+import Model from '../models/account/account.model';
+
+const Accounts = service({ Model, whitelist: ['$options', '$regex'] });
+
+export default (app: Application): void => {
+ app.use('/accounts', Accounts);
+};
+
diff --git a/src/services/index.ts b/src/services/index.ts
index b94380d..499ab68 100644
--- a/src/services/index.ts
+++ b/src/services/index.ts
@@ -1,4 +1,5 @@
import { Application } from '@feathersjs/express';
+import Accounts from './accounts.service';
import Products from './products.service';
import Contractors from './contractors.service';
import Waybills from './waybills.service';
@@ -9,6 +10,7 @@ import sortByDate from '../hooks/sortByDate';
import ignoreCaseRegex from '../hooks/ignoreCaseRegex';
export default (app: Application): void => {
+ app.configure(Accounts);
app.configure(Products);
app.configure(Contractors);
app.configure(Waybills);