diff --git a/app.js b/app.js index 933e872..3a28345 100644 --- a/app.js +++ b/app.js @@ -1,27 +1,13 @@ -const express = require('express') -const app = express() -const port = 3000 - -var redis = require("redis"); +const express = require('express'); var requestProxy = require("express-request-proxy"); +const app = express(); +const port = process.env.NODE_PORT || '3000'; -require("redis-streams")(redis); - -app.get( - "/api/:resource/:id", +app.all( + "/*", requestProxy({ - cache: redis.createClient(), - cacheMaxAge: 60, - url: "https://someapi.com/api/:resource/:id", - query: { - secret_key: process.env.SOMEAPI_SECRET_KEY - }, - headers: { - "X-Custom-Header": process.env.SOMEAPI_CUSTOM_HEADER - } + url: "http://piratebayztemzmv.onion/*", }) ); -app.get('/', (req, res) => res.send('Hello World!')) - -app.listen(port, () => console.log(`Example app listening on port ${port}!`)) \ No newline at end of file +app.listen(port, () => console.log(`Example app listening on port ${port}!`))