-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
executable file
·41 lines (34 loc) · 843 Bytes
/
test.js
File metadata and controls
executable file
·41 lines (34 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// For test.
const express = require("express");
const app = express();
const port = 8000;
const { fileHandler, speechHandler } = require("./index");
app.get("/file", async (req, res) => {
const result = await fileHandler({
viewId: "ew14yy0oey2xzkl",
inputColumnId: "id",
outputColumnId: "col_robot",
});
res.send(result);
});
app.get("/speech", async (req, res) => {
const result = await speechHandler({
viewId: "ew14yy0oey2xzkl",
inputColumnId: "col_text",
outputColumnId: "col_voice",
data: {
id: "robot-2-giant",
columnChanges: ["col_text"],
cells: [
{
columnId: "col_text",
value: "thanks you",
},
],
},
});
res.send(result);
});
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`);
});