File size: 555 Bytes
cd8fa1f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b324f76
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import express from 'express';
import {OpenaiRes} from '../scrapper.js';
const GptRoutes = express.Router();

/**
 * @swagger
 * /api/v1/gpt-old:
 *   get:
 *     summary: GPT OLD version turbo
 *     responses:
 *       200:
 *         description: Success
 */
GptRoutes.get('/api/v1/gpt-old', async (req, res) => {
    try {
        const query = req.query.query;
        const results = await OpenaiRes(query);
        res.json({ results });
    } catch (error) {
        res.status(401).json({ error: error.message });
    }
});

export { GptRoutes };