Update plugins/tebak.js
Browse files- plugins/tebak.js +23 -1
plugins/tebak.js
CHANGED
@@ -1,3 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
app.get('/api/v1/tebakgambar', async (req, res) => {
|
2 |
try {
|
3 |
const result = await tebakgambar();
|
@@ -9,4 +29,6 @@ app.get('/api/v1/tebakgambar', async (req, res) => {
|
|
9 |
} catch (error) {
|
10 |
res.status(500).json({ error: error.message });
|
11 |
}
|
12 |
-
});
|
|
|
|
|
|
1 |
+
import express from 'express';
|
2 |
+
import { tebakgambar } from '../scrapper.js';
|
3 |
+
const TebakRoutes = express.Router();
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @swagger
|
7 |
+
* /api/v1/tebakgambar:
|
8 |
+
* get:
|
9 |
+
* summary: tebak gambar Random
|
10 |
+
* parameters:
|
11 |
+
* - in: query
|
12 |
+
* name: query
|
13 |
+
* required: true
|
14 |
+
* description: null
|
15 |
+
* schema:
|
16 |
+
* type: string
|
17 |
+
* responses:
|
18 |
+
* 200:
|
19 |
+
* description: Success
|
20 |
+
*/
|
21 |
app.get('/api/v1/tebakgambar', async (req, res) => {
|
22 |
try {
|
23 |
const result = await tebakgambar();
|
|
|
29 |
} catch (error) {
|
30 |
res.status(500).json({ error: error.message });
|
31 |
}
|
32 |
+
});
|
33 |
+
|
34 |
+
export { TebakRoutes };
|