randydev commited on
Commit
e67e90e
·
verified ·
1 Parent(s): ded0ba9

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +34 -10
index.js CHANGED
@@ -36,6 +36,7 @@ import { CheckMilWare } from './midware.js';
36
 
37
  // routes
38
  import { GeminiRoutes } from './routes/googleGemini.js';
 
39
  const CheckMilWares = new CheckMilWare();
40
 
41
  app.disable('x-powered-by');
@@ -54,6 +55,39 @@ app.use(
54
  // routes
55
  app.use(GeminiRoute);
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  app.get('/', (req, res) => {
58
  res.redirect('https://t.me/RendyProjects');
59
  });
@@ -80,16 +114,6 @@ app.get('/api/v1/hentai-anime', async (req, res) => {
80
  }
81
  });
82
 
83
- app.get("/api/v1/google-gemini", async (req, res) => {
84
- try {
85
- const query = req.query.query;
86
- const setmodel = req.query.setmodel || "gemini-1.5-flash"
87
- const results = await GeminiResponse(query, setmodel);
88
- res.json({ message: results });
89
- } catch (e) {
90
- res.status(500).json({ error: e.message });
91
- }
92
- });
93
 
94
  app.get('/api/v1/tebakgambar', async (req, res) => {
95
  try {
 
36
 
37
  // routes
38
  import { GeminiRoutes } from './routes/googleGemini.js';
39
+
40
  const CheckMilWares = new CheckMilWare();
41
 
42
  app.disable('x-powered-by');
 
55
  // routes
56
  app.use(GeminiRoute);
57
 
58
+ const swaggerOptions = {
59
+ definition: {
60
+ openapi: '3.0.0',
61
+ info: {
62
+ title: 'AkenoXJs',
63
+ version: '1.0.0',
64
+ description: "Free API by @xtdevs",
65
+ contact: {
66
+ name: "RandyDev",
67
+ url: "",
68
+ email: ""
69
+ },
70
+ license: {
71
+ name: "MIT LICENSE",
72
+ url: "https://github.com/xtsea/x-api-js/blob/main/LICENSE"
73
+ }
74
+ },
75
+ servers: [
76
+ {
77
+ url: 'https://randydev-ryu-js.hf.space',
78
+ description: 'url'
79
+ }
80
+ ],
81
+ tags: [
82
+ { name: "AI" }
83
+ ]
84
+ },
85
+ apis: ["./routes/*.js", "./routes/*.route.js"]
86
+ };
87
+
88
+ const specs = swaggerJsDoc(swaggerOptions);
89
+
90
+
91
  app.get('/', (req, res) => {
92
  res.redirect('https://t.me/RendyProjects');
93
  });
 
114
  }
115
  });
116
 
 
 
 
 
 
 
 
 
 
 
117
 
118
  app.get('/api/v1/tebakgambar', async (req, res) => {
119
  try {