Create tebak.js
Browse files- plugins/tebak.js +12 -0
plugins/tebak.js
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
app.get('/api/v1/tebakgambar', async (req, res) => {
|
2 |
+
try {
|
3 |
+
const result = await tebakgambar();
|
4 |
+
if (result) {
|
5 |
+
res.json({ result });
|
6 |
+
} else {
|
7 |
+
res.status(404).json({ error: "No result found." });
|
8 |
+
}
|
9 |
+
} catch (error) {
|
10 |
+
res.status(500).json({ error: error.message });
|
11 |
+
}
|
12 |
+
});
|