Update index.js
Browse files
index.js
CHANGED
@@ -27,6 +27,7 @@ import * as cheerio from 'cheerio';
|
|
27 |
import * as lifestyle from './lifestyle.js';
|
28 |
|
29 |
import sharp from "sharp";
|
|
|
30 |
import { Readable } from "stream";
|
31 |
import bodyParser from 'body-parser';
|
32 |
import { schellwithflux } from './fluxai.js';
|
@@ -34,9 +35,16 @@ import { OpenaiRes, tebakgambar, AnimeHentai } from './scrapper.js';
|
|
34 |
import { GeminiResponse } from './googleGemini.js';
|
35 |
import { CheckMilWare } from './midware.js';
|
36 |
|
|
|
|
|
37 |
const CheckMilWares = new CheckMilWare();
|
38 |
|
39 |
app.disable('x-powered-by');
|
|
|
|
|
|
|
|
|
|
|
40 |
app.use(bodyParser.json());
|
41 |
app.use(
|
42 |
bodyParser.urlencoded({
|
@@ -44,6 +52,9 @@ app.use(
|
|
44 |
})
|
45 |
);
|
46 |
|
|
|
|
|
|
|
47 |
app.get('/', (req, res) => {
|
48 |
res.redirect('https://t.me/RendyProjects');
|
49 |
});
|
|
|
27 |
import * as lifestyle from './lifestyle.js';
|
28 |
|
29 |
import sharp from "sharp";
|
30 |
+
import cors from 'cors';
|
31 |
import { Readable } from "stream";
|
32 |
import bodyParser from 'body-parser';
|
33 |
import { schellwithflux } from './fluxai.js';
|
|
|
35 |
import { GeminiResponse } from './googleGemini.js';
|
36 |
import { CheckMilWare } from './midware.js';
|
37 |
|
38 |
+
// routes
|
39 |
+
import { GeminiRoutes } from './routes/GoogleGemini.js';
|
40 |
const CheckMilWares = new CheckMilWare();
|
41 |
|
42 |
app.disable('x-powered-by');
|
43 |
+
app.use(cors({
|
44 |
+
origin: '*',
|
45 |
+
methods: ['GET', 'POST'],
|
46 |
+
allowedHeaders: ['Content-Type', 'Authorization']
|
47 |
+
}));
|
48 |
app.use(bodyParser.json());
|
49 |
app.use(
|
50 |
bodyParser.urlencoded({
|
|
|
52 |
})
|
53 |
);
|
54 |
|
55 |
+
// routes
|
56 |
+
app.use(GeminiRoute);
|
57 |
+
|
58 |
app.get('/', (req, res) => {
|
59 |
res.redirect('https://t.me/RendyProjects');
|
60 |
});
|