Spaces:
Runtime error
Runtime error
Charlie
commited on
Commit
·
2b6c488
1
Parent(s):
de3f96c
update
Browse files
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
emoji: 🐠
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: yellow
|
|
|
|
| 1 |
---
|
| 2 |
+
title: whdemo
|
| 3 |
emoji: 🐠
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: yellow
|
server.ts
CHANGED
|
@@ -2,14 +2,6 @@ import * as express from "express";
|
|
| 2 |
|
| 3 |
const PORT = 7860;
|
| 4 |
|
| 5 |
-
if (!process.env.WEBHOOK_SECRET || !process.env.HF_TOKEN) {
|
| 6 |
-
console.error(
|
| 7 |
-
"This app needs those env variables to be defined",
|
| 8 |
-
"WEBHOOK_SECRET, HF_TOKEN"
|
| 9 |
-
);
|
| 10 |
-
process.exit();
|
| 11 |
-
}
|
| 12 |
-
|
| 13 |
const app = express();
|
| 14 |
app.use(express.json());
|
| 15 |
|
|
@@ -17,12 +9,8 @@ app.get("/", (req, res) => {
|
|
| 17 |
res.json({ hello: "world" });
|
| 18 |
});
|
| 19 |
|
| 20 |
-
app.post("
|
| 21 |
-
|
| 22 |
-
console.error("incorrect secret");
|
| 23 |
-
return res.status(400).json({ error: "incorrect secret" });
|
| 24 |
-
}
|
| 25 |
-
console.log(req.body);
|
| 26 |
res.json({ success: true });
|
| 27 |
});
|
| 28 |
|
|
|
|
| 2 |
|
| 3 |
const PORT = 7860;
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
const app = express();
|
| 6 |
app.use(express.json());
|
| 7 |
|
|
|
|
| 9 |
res.json({ hello: "world" });
|
| 10 |
});
|
| 11 |
|
| 12 |
+
app.post("*", async (req, res) => {
|
| 13 |
+
console.log("ok");
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
res.json({ success: true });
|
| 15 |
});
|
| 16 |
|