Custom alias for JSON streaming
This commit is contained in:
@@ -52,30 +52,33 @@ export default class ProductsService extends Service {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
getComicCovers: {
|
// getComicCovers: {
|
||||||
rest: "POST /getComicCovers",
|
// rest: "POST /getComicCovers",
|
||||||
params: {
|
// params: {
|
||||||
extractionOptions: "object",
|
// extractionOptions: "object",
|
||||||
walkedFolders: "array",
|
// walkedFolders: "array",
|
||||||
},
|
// },
|
||||||
async handler(
|
// async handler(
|
||||||
ctx: Context<{
|
// ctx: Context<{
|
||||||
extractionOptions: IExtractionOptions;
|
// extractionOptions: IExtractionOptions;
|
||||||
walkedFolders: IFolderData[];
|
// walkedFolders: IFolderData[];
|
||||||
}>
|
// }>
|
||||||
) {
|
// ) {
|
||||||
const readStream = fs.createReadStream(
|
//
|
||||||
"./userdata/comicBooksForImport.js"
|
// },
|
||||||
);
|
// },
|
||||||
const comicBooksForImport = await getCovers(
|
},
|
||||||
ctx.params.extractionOptions,
|
methods: {
|
||||||
ctx.params.walkedFolders
|
getComicCovers(extractionConfiguration) {
|
||||||
);
|
return (req, res) => (err) => {
|
||||||
readStream.pipe(comicBooksForImport);
|
if (err) {
|
||||||
},
|
this.logger.warn("Halkat mard", err);
|
||||||
|
this.sendError(req, res, err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {},
|
|
||||||
},
|
},
|
||||||
schema
|
schema
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user