parent
e9b1963d06
commit
b98e77e641
8 changed files with 41 additions and 0 deletions
@ -0,0 +1,15 @@ |
||||
FROM keymetrics/pm2:latest-alpine |
||||
|
||||
# Bundle APP files |
||||
COPY src src/ |
||||
COPY package.json . |
||||
COPY pm2.json . |
||||
|
||||
# Install app dependencies |
||||
ENV NPM_CONFIG_LOGLEVEL warn |
||||
RUN npm install --production |
||||
|
||||
# Show current folder structure in logs |
||||
RUN ls -al -R |
||||
|
||||
CMD [ "pm2-runtime", "start", "pm2.json" ] |
@ -0,0 +1,11 @@ |
||||
{ |
||||
"name": "ushio-proxy", |
||||
"script": "src/index.js", |
||||
"instances": "1", |
||||
"env": { |
||||
"NODE_ENV": "development" |
||||
}, |
||||
"env_production" : { |
||||
"NODE_ENV": "production" |
||||
} |
||||
} |
@ -0,0 +1,15 @@ |
||||
const express = require('express') |
||||
const request = require('request'); |
||||
const app = express() |
||||
const port = 3000 |
||||
|
||||
app.listen(port, () => console.log(`Ushio-proxy listening at http://localhost:${port}`)) |
||||
app.use(express.static(__dirname + '/public')); |
||||
|
||||
app.get('/get/', (req, res) => { |
||||
|
||||
if(req.query.hasOwnProperty('url')){ |
||||
request(new Buffer(req.query.url, 'base64').toString()).pipe(res); |
||||
} |
||||
|
||||
}) |
Before Width: | Height: | Size: 490 KiB After Width: | Height: | Size: 490 KiB |
Loading…
Reference in new issue