diff options
author | eug-vs <eug-vs@keemail.me> | 2021-03-20 15:32:30 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2021-03-20 15:33:35 +0300 |
commit | 2434c687bbc8f5b42b380a75e48cf1879a508674 (patch) | |
tree | 76bf1a2399eebb67c6bda52c7f33278cff0ff7cd /src/services | |
parent | 8b2f747ae1fb5476da860a5bd90b9b66b61dde99 (diff) | |
download | commercel-api-2434c687bbc8f5b42b380a75e48cf1879a508674.tar.gz |
feat: initialize Uploads service
Diffstat (limited to 'src/services')
-rw-r--r-- | src/services/index.ts | 2 | ||||
-rw-r--r-- | src/services/uploads.service.ts | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/services/index.ts b/src/services/index.ts index 5ecbc15..2c3430c 100644 --- a/src/services/index.ts +++ b/src/services/index.ts @@ -4,6 +4,7 @@ import Contractors from './contractors.service'; import Waybills from './waybills.service'; import Tranfers from './transfers.service'; import Spreadsheets from './spreadsheets.service'; +import Uploads from './uploads.service'; export default (app: Application): void => { app.configure(Products); @@ -11,6 +12,7 @@ export default (app: Application): void => { app.configure(Waybills); app.configure(Tranfers); app.configure(Spreadsheets); + app.configure(Uploads); app.get('/ping', (req, res) => res.send('pong')); }; diff --git a/src/services/uploads.service.ts b/src/services/uploads.service.ts new file mode 100644 index 0000000..520079f --- /dev/null +++ b/src/services/uploads.service.ts @@ -0,0 +1,13 @@ +import { Application } from '@feathersjs/express'; +import blobService from 'feathers-blob'; +import fs from 'fs-blob-store'; +import Bluebird from 'bluebird'; +import _ from 'lodash'; + +const blobStorage = fs('./uploads'); + +const uploads = blobService({ Model: blobStorage }); + +export default (app: Application): void => { + app.use('/uploads', uploads) +}; |