This commit is contained in:
2021-05-13 15:09:58 -07:00
parent 833c4570e1
commit 6eb0c611ee
2 changed files with 5 additions and 5 deletions

View File

@@ -39,6 +39,7 @@
"react": "^17.0.1", "react": "^17.0.1",
"react-dom": "^17.0.1", "react-dom": "^17.0.1",
"react-hooks-worker": "^1.0.0", "react-hooks-worker": "^1.0.0",
"request": "^2.88.2",
"sharp": "^0.28.1", "sharp": "^0.28.1",
"stream-json": "^1.7.1", "stream-json": "^1.7.1",
"through2": "^4.0.2" "through2": "^4.0.2"

View File

@@ -4,6 +4,7 @@ import axios from "axios";
import stream from "stream"; import stream from "stream";
import through2 from "through2"; import through2 from "through2";
import hyperquest from "hyperquest"; import hyperquest from "hyperquest";
import request from "request";
import es from "event-stream"; import es from "event-stream";
import JSONStream from "JSONStream"; import JSONStream from "JSONStream";
import oboe from "oboe"; import oboe from "oboe";
@@ -12,17 +13,15 @@ router.route("/getComicCovers").post(async (req: Request, res: Response) => {
typeof req.body.extractionOptions === "object" typeof req.body.extractionOptions === "object"
? req.body.extractionOptions ? req.body.extractionOptions
: {}; : {};
oboe({ request({
url: "http://localhost:3000/api/import/getComicCovers", url: "http://localhost:3000/api/import/getComicCovers",
method: "POST", method: "POST",
json: true,
body: { body: {
extractionOptions: req.body.extractionOptions, extractionOptions: req.body.extractionOptions,
walkedFolders: req.body.walkedFolders, walkedFolders: req.body.walkedFolders,
}, },
}).on("node", ".*", (data) => { }).pipe(res);
console.log(data);
res.write(JSON.stringify(data));
});
}); });
router.route("/walkFolder").post(async (req: Request, res: Response) => { router.route("/walkFolder").post(async (req: Request, res: Response) => {