🧶 Still WIP on Streaming JSON
This commit is contained in:
@@ -1,24 +1,28 @@
|
||||
import router from "../router";
|
||||
import { Request, Response } from "express";
|
||||
import axios from "axios";
|
||||
import { Readable } from "stream";
|
||||
import stream from "stream";
|
||||
import through2 from "through2";
|
||||
import hyperquest from "hyperquest";
|
||||
import es from "event-stream";
|
||||
import JSONStream from "JSONStream";
|
||||
import oboe from "oboe";
|
||||
|
||||
router.route("/getComicCovers").post(async (req: Request, res: Response) => {
|
||||
typeof req.body.extractionOptions === "object"
|
||||
? req.body.extractionOptions
|
||||
: {};
|
||||
const comicBookCoversData = hyperquest.post("http://localhost:3853/api/import/getComicCovers",
|
||||
{
|
||||
data: {
|
||||
oboe({
|
||||
url: "http://localhost:3000/api/import/getComicCovers",
|
||||
method: "POST",
|
||||
body: {
|
||||
extractionOptions: req.body.extractionOptions,
|
||||
walkedFolders: req.body.walkedFolders,
|
||||
},
|
||||
}).on("node", ".*", (data) => {
|
||||
console.log(data);
|
||||
res.write(JSON.stringify(data));
|
||||
});
|
||||
console.log(comicBookCoversData.data);
|
||||
|
||||
});
|
||||
|
||||
router.route("/walkFolder").post(async (req: Request, res: Response) => {
|
||||
|
||||
Reference in New Issue
Block a user