File size: 3,044 Bytes
70335fc 6f115e7 70335fc cc43160 1c2f245 83075c1 f836f2f 3dd504b 2a1da11 dd9b2ad ea9ab95 8e9d6ef ea9ab95 aaeefe8 03eff68 dd7e9fe 03eff68 1736687 b749907 e9a4054 f38b6df 4ae50c2 43320de ded0ba9 e67e90e 1122fa5 1c8c6b7 6d18814 594fd9f e28d3f7 091ea21 43cc2ca 594fd9f 6d18814 ca3f718 03eff68 1736687 b749907 e9a4054 dd7e9fe f38b6df 43320de 4ae50c2 6d18814 e67e90e ea9ab95 e67e90e dc7aadc 90e4651 dc7aadc 1c2f245 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
/*
Credits @xpushz on telegram
Copyright 2017-2025 (c) Randy W @xtdevs, @xtsea on telegram
from : https://github.com/TeamKillerX
Channel : @RendyProjects
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import express from 'express';
const app = express();
import * as swaggerUi from 'swagger-ui-express';
import * as cheerio from 'cheerio';
import * as lifestyle from './startup/lifestyle.js';
import { Readable } from "stream";
import { CheckMilWare } from './middleware/midware.js';
import { setup, serve } from './swagger.js';
import { swaggerOptions } from './settingOptions.js';
import sharp from "sharp";
import cors from 'cors';
import bodyParser from 'body-parser';
import swaggerJsDoc from 'swagger-jsdoc';
// routes
import { GempaRoutes } from './plugins/gempa.js';
import { FluxRoutes } from './plugins/fluxai.js';
import { GptRoutes } from './plugins/gptold.js';
import { HentaiRoutes } from './plugins/hentai.js';
import { TebakRoutes } from './plugins/tebak.js';
import { CopilotRoutes } from './plugins/copilot.js';
import { CarbonRoutes } from './plugins/carbon.js';
import { UnblockIpRoutes } from './plugins/unblockip.js';
import { GeminiRoutes } from './routes/googleGemini.js';
const CheckMilWares = new CheckMilWare();
app.disable("x-powered-by");
app.disable("link")
app.use(cors({
origin: '*',
methods: ['GET', 'POST'],
allowedHeaders: ['Content-Type', 'Authorization']
}));
app.use(bodyParser.json());
app.use(
bodyParser.urlencoded({
extended: true,
})
);
app.use(async (req, res, next) => {
await CheckMilWares.handle(req, res, next);
});
// routes
app.use(GeminiRoutes);
app.use(FluxRoutes);
app.use(GptRoutes);
app.use(HentaiRoutes);
app.use(TebakRoutes);
app.use(GempaRoutes);
app.use(CopilotRoutes);
app.use(UnblockIpRoutes);
app.use(CarbonRoutes);
const specs = swaggerJsDoc(swaggerOptions);
app.use(
'/docs',
serve,
setup(specs, {
customCss: `
.swagger-ui .topbar { display: none; }
.swagger-ui .opblock .opblock-summary-path {
display: inline-block;
word-break: break-word;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
}
`,
customCssUrl: "https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.3.0/swagger-ui.min.css",
customSiteTitle: 'AkenoXJs'
})
);
app.get('/', (req, res) => {
res.redirect('https://t.me/RendyProjects');
});
lifestyle.startServer(app); |