jbilcke-hf HF staff commited on
Commit
4d290bc
·
1 Parent(s): cd54a16

investigating

Browse files
Files changed (1) hide show
  1. src/index.ts +6 -5
src/index.ts CHANGED
@@ -45,7 +45,8 @@ app.get("/", async (req, res) => {
45
 
46
  // the export robot has only one job: to export .clap files
47
  app.post("/", async (req, res) => {
48
-
 
49
  const qs = queryString.parseUrl(req.url || "")
50
  const query = (qs || {}).query
51
 
@@ -64,20 +65,20 @@ app.post("/", async (req, res) => {
64
  });
65
 
66
  req.on("end", async () => {
67
- let clapProject: ClapProject
68
  try {
69
  let fileData = Buffer.concat(data)
70
 
71
  const clap: ClapProject = await parseClap(new Blob([fileData]));
72
 
73
  // not! that is too large!!!
74
- // console.log("got a clap project:", clap)
75
 
76
  const {
77
  tmpWorkDir,
78
  outputFilePath,
79
  } = await clapToTmpVideoFilePath({ clap, format })
80
- // console.log(`got an output ${format} file at:`, outputFilePath)
 
81
 
82
  res.download(outputFilePath, async () => {
83
  // clean-up after ourselves (we clear the whole tmp directory)
@@ -86,7 +87,7 @@ app.post("/", async (req, res) => {
86
  })
87
  return
88
  } catch (err) {
89
- console.error(`failed to parse the request: ${err}`)
90
  res.status(500)
91
  res.write(JSON.stringify({ "error": `${err}` }))
92
  res.end()
 
45
 
46
  // the export robot has only one job: to export .clap files
47
  app.post("/", async (req, res) => {
48
+ console.log("receiving POST request")
49
+
50
  const qs = queryString.parseUrl(req.url || "")
51
  const query = (qs || {}).query
52
 
 
65
  });
66
 
67
  req.on("end", async () => {
 
68
  try {
69
  let fileData = Buffer.concat(data)
70
 
71
  const clap: ClapProject = await parseClap(new Blob([fileData]));
72
 
73
  // not! that is too large!!!
74
+ console.log("got a clap project:", clap?.meta?.description)
75
 
76
  const {
77
  tmpWorkDir,
78
  outputFilePath,
79
  } = await clapToTmpVideoFilePath({ clap, format })
80
+
81
+ console.log(`got an output ${format} file at:`, outputFilePath)
82
 
83
  res.download(outputFilePath, async () => {
84
  // clean-up after ourselves (we clear the whole tmp directory)
 
87
  })
88
  return
89
  } catch (err) {
90
+ console.log(`failed to process the request\n${err}`)
91
  res.status(500)
92
  res.write(JSON.stringify({ "error": `${err}` }))
93
  res.end()