Update index.js
Browse files
index.js
CHANGED
@@ -27,18 +27,18 @@ app.get('/api/test', async (req, res) => {
|
|
27 |
|
28 |
app.get('/api/tebakgambar', async (req, res) => {
|
29 |
try {
|
30 |
-
await tebakgambar()
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
});
|
37 |
} catch (error) {
|
38 |
-
res.status(
|
39 |
}
|
40 |
});
|
41 |
|
|
|
42 |
app.get('/api/gpt-old', async (req, res) => {
|
43 |
try {
|
44 |
const query = req.query.query;
|
|
|
27 |
|
28 |
app.get('/api/tebakgambar', async (req, res) => {
|
29 |
try {
|
30 |
+
const result = await tebakgambar();
|
31 |
+
if (result) {
|
32 |
+
res.json({ result });
|
33 |
+
} else {
|
34 |
+
res.status(404).json({ error: "No result found." });
|
35 |
+
}
|
|
|
36 |
} catch (error) {
|
37 |
+
res.status(500).json({ error: error.message });
|
38 |
}
|
39 |
});
|
40 |
|
41 |
+
|
42 |
app.get('/api/gpt-old', async (req, res) => {
|
43 |
try {
|
44 |
const query = req.query.query;
|