Update index.js
Browse files
index.js
CHANGED
|
@@ -232,7 +232,40 @@ const app = express()
|
|
| 232 |
.set('json spaces', 4)
|
| 233 |
.use(morgan('dev'))
|
| 234 |
.use(express.json())
|
| 235 |
-
.all('/', (_, res) => res.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 236 |
.get('/yt', async (req, res) => {
|
| 237 |
const host = 'https://' + req.get('host');
|
| 238 |
try {
|
|
@@ -264,7 +297,7 @@ const app = express()
|
|
| 264 |
res.json({ message: e });
|
| 265 |
}
|
| 266 |
})
|
| 267 |
-
.get('/
|
| 268 |
try {
|
| 269 |
let q = req.query.q || req.query.query;
|
| 270 |
if (!q) return res.json({ message: 'Input parameter q' });
|
|
|
|
| 232 |
.set('json spaces', 4)
|
| 233 |
.use(morgan('dev'))
|
| 234 |
.use(express.json())
|
| 235 |
+
.all('/', (_, res) => res.json({
|
| 236 |
+
"apiList": [
|
| 237 |
+
{
|
| 238 |
+
"title": "Tiktok Downloader",
|
| 239 |
+
"endpoint": "/tt",
|
| 240 |
+
"method": "GET",
|
| 241 |
+
"example": `${host}/tt?url=`,
|
| 242 |
+
},
|
| 243 |
+
{
|
| 244 |
+
"title": "Facebook Downloader",
|
| 245 |
+
"endpoint": "/fb",
|
| 246 |
+
"method": "GET",
|
| 247 |
+
"example": `${host}/fb?url=`,
|
| 248 |
+
},
|
| 249 |
+
{
|
| 250 |
+
"title": "Instagram Downloader",
|
| 251 |
+
"endpoint": "/ig",
|
| 252 |
+
"method": "GET",
|
| 253 |
+
"example": `${host}/ig?url=`,
|
| 254 |
+
},
|
| 255 |
+
{
|
| 256 |
+
"title": "Youtube Downloader",
|
| 257 |
+
"endpoint": "/ytdl",
|
| 258 |
+
"method": "GET",
|
| 259 |
+
"example": `${host}/ytdl?url=`,
|
| 260 |
+
},
|
| 261 |
+
{
|
| 262 |
+
"title": "Youtube Search",
|
| 263 |
+
"endpoint": "/ytsearch",
|
| 264 |
+
"method": "GET",
|
| 265 |
+
"example": `${host}/ytsearch?url=`,
|
| 266 |
+
}
|
| 267 |
+
]
|
| 268 |
+
}))
|
| 269 |
.get('/yt', async (req, res) => {
|
| 270 |
const host = 'https://' + req.get('host');
|
| 271 |
try {
|
|
|
|
| 297 |
res.json({ message: e });
|
| 298 |
}
|
| 299 |
})
|
| 300 |
+
.get('/ytsearch', async (req, res) => {
|
| 301 |
try {
|
| 302 |
let q = req.query.q || req.query.query;
|
| 303 |
if (!q) return res.json({ message: 'Input parameter q' });
|