Update index.js
Browse files
index.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import express from 'express';
|
2 |
-
import swaggerDocument from './swagger.json' assert { type: 'json' };
|
3 |
const app = express()
|
4 |
|
5 |
import * as swaggerUi from 'swagger-ui-express';
|
@@ -10,13 +9,8 @@ import * as lifestyle from './lifestyle.js';
|
|
10 |
import { OpenaiRes, tebakgambar, AnimeHentai } from './scrapper.js';
|
11 |
import { CheckMilWare } from './midware.js';
|
12 |
|
13 |
-
import { router as exampleRouter } from './routes/example.js';
|
14 |
-
|
15 |
const CheckMilWares = new CheckMilWare();
|
16 |
|
17 |
-
app.use('/api', exampleRouter);
|
18 |
-
app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));
|
19 |
-
|
20 |
app.get('/', (req, res) => {
|
21 |
res.redirect('https://t.me/RendyProjects');
|
22 |
});
|
@@ -35,7 +29,7 @@ app.get('/api/test', async (req, res) => {
|
|
35 |
|
36 |
app.get('/api/hentai-anime', async (req, res) => {
|
37 |
try {
|
38 |
-
const result = await
|
39 |
if (result) {
|
40 |
res.json({ result });
|
41 |
} else {
|
@@ -48,7 +42,7 @@ app.get('/api/hentai-anime', async (req, res) => {
|
|
48 |
|
49 |
app.get('/api/tebakgambar', async (req, res) => {
|
50 |
try {
|
51 |
-
const result = await
|
52 |
if (result) {
|
53 |
res.json({ result });
|
54 |
} else {
|
@@ -63,7 +57,7 @@ app.get('/api/tebakgambar', async (req, res) => {
|
|
63 |
app.get('/api/gpt-old', async (req, res) => {
|
64 |
try {
|
65 |
const query = req.query.query;
|
66 |
-
const results = await
|
67 |
res.json({ results });
|
68 |
} catch (error) {
|
69 |
res.status(401).json({ error: error.message });
|
|
|
1 |
import express from 'express';
|
|
|
2 |
const app = express()
|
3 |
|
4 |
import * as swaggerUi from 'swagger-ui-express';
|
|
|
9 |
import { OpenaiRes, tebakgambar, AnimeHentai } from './scrapper.js';
|
10 |
import { CheckMilWare } from './midware.js';
|
11 |
|
|
|
|
|
12 |
const CheckMilWares = new CheckMilWare();
|
13 |
|
|
|
|
|
|
|
14 |
app.get('/', (req, res) => {
|
15 |
res.redirect('https://t.me/RendyProjects');
|
16 |
});
|
|
|
29 |
|
30 |
app.get('/api/hentai-anime', async (req, res) => {
|
31 |
try {
|
32 |
+
const result = await AnimeHentai();
|
33 |
if (result) {
|
34 |
res.json({ result });
|
35 |
} else {
|
|
|
42 |
|
43 |
app.get('/api/tebakgambar', async (req, res) => {
|
44 |
try {
|
45 |
+
const result = await tebakgambar();
|
46 |
if (result) {
|
47 |
res.json({ result });
|
48 |
} else {
|
|
|
57 |
app.get('/api/gpt-old', async (req, res) => {
|
58 |
try {
|
59 |
const query = req.query.query;
|
60 |
+
const results = await OpenaiRes(query);
|
61 |
res.json({ results });
|
62 |
} catch (error) {
|
63 |
res.status(401).json({ error: error.message });
|