diff options
author | eug-vs <eug-vs@keemail.me> | 2021-03-14 06:44:05 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2021-03-14 06:44:05 +0300 |
commit | 1b86dcef9fd537db800e0df2c2f3889ffbc69723 (patch) | |
tree | f44f2d6a21075ac69d01b8b4a298939146fd9bd3 /src/services | |
parent | dc00c06719b5192518a67177caafe28f5027c16c (diff) | |
download | commercel-api-1b86dcef9fd537db800e0df2c2f3889ffbc69723.tar.gz |
feat: add products service
Diffstat (limited to 'src/services')
-rw-r--r-- | src/services/index.ts | 8 | ||||
-rw-r--r-- | src/services/products/products.service.ts | 10 |
2 files changed, 18 insertions, 0 deletions
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); +}; + |