mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 03:28:35 +01:00
update thignys
This commit is contained in:
parent
5c0e4bc21e
commit
714d988aa7
1 changed files with 7 additions and 12 deletions
19
p/server.js
19
p/server.js
|
@ -2,13 +2,16 @@ const fs = require("fs");
|
|||
const express = require("express");
|
||||
const fetch = require("node-fetch");
|
||||
const htmlParser = require("node-html-parser");
|
||||
const lyrics = require("./lyrics.js");
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(express.json()); // for parsing application/json
|
||||
app.use(express.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
|
||||
|
||||
app.use(function (req, res, next) {
|
||||
res.header("Access-Control-Allow-Origin", "*");
|
||||
next();
|
||||
});
|
||||
let Proxy = async (req, res) => {
|
||||
const url = "https://" + req.originalUrl.slice(10);
|
||||
|
||||
|
@ -43,18 +46,10 @@ const listener = (req, res) => {
|
|||
Proxy(req, res);
|
||||
};
|
||||
|
||||
app.get("/", (req, res) => res.redirect(`https://poketube.fun/watch?v=l3eww1dnd0k&trck=we_dont_lol&hi=mom&i_like_this=yes&omgfr=tru&AAAAA=BBBBBB&unclebenwhathappend=squidgames`));
|
||||
|
||||
app.get("/", (req, res) =>
|
||||
res.redirect(`https://poketube.fun/watch?v=l3eww1dnd0k`)
|
||||
);
|
||||
|
||||
app.get("/api/lyrics", async (req, res) => {
|
||||
const query = req.query.query;
|
||||
|
||||
res.json(await lyrics(query))
|
||||
|
||||
});
|
||||
|
||||
|
||||
app.all("/*", listener);
|
||||
|
||||
app.listen(3000, () => {});
|
||||
|
||||
|
|
Loading…
Reference in a new issue