From 1b86dcef9fd537db800e0df2c2f3889ffbc69723 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 14 Mar 2021 06:44:05 +0300 Subject: feat: add products service --- src/services/index.ts | 8 ++++++++ src/services/products/products.service.ts | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/services/index.ts create mode 100644 src/services/products/products.service.ts (limited to 'src/services') diff --git a/src/services/index.ts b/src/services/index.ts new file mode 100644 index 0000000..d35ac27 --- /dev/null +++ b/src/services/index.ts @@ -0,0 +1,8 @@ +import { Application } from '@feathersjs/express'; +import Products from './products/products.service'; + +export default (app: Application): void => { + app.configure(Products); + + app.get('/ping', (req, res) => res.send('pong')); +}; diff --git a/src/services/products/products.service.ts b/src/services/products/products.service.ts new file mode 100644 index 0000000..6461dae --- /dev/null +++ b/src/services/products/products.service.ts @@ -0,0 +1,10 @@ +import { Application } from '@feathersjs/express'; +import service from 'feathers-mongoose'; +import Model from '../../models/product/product.model'; + +const Products = service({ Model }); + +export default (app: Application): void => { + app.use('/products', Products); +}; + -- cgit v1.2.3