@426729/

Proxy

Express

No description

fork
loading
Files
  • index.js
  • db.js
  • db.sqlite3
  • index.html
  • package-lock.json
  • package.json

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.017504841001389826","path":"index.js","file":{"path":"index.js","content":{"asEncoding":{"base64":"Y29uc3QgZXhwcmVzcyA9IHJlcXVpcmUoJ2V4cHJlc3MnKTsKY29uc3QgYm9keVBhcnNlciA9IHJlcXVpcmUoJ2JvZHktcGFyc2VyJyk7CmNvbnN0IGRiID0gcmVxdWlyZSgnLi9kYicpOwpjb25zdCBwcm94eSA9IHJlcXVpcmUoJ2V4cHJlc3MtaHR0cC1wcm94eScpOwpjb25zdCBhcHAgPSBleHByZXNzKCk7CmFwcC51c2UoJyonLChyZXEscmVzLG5leHQpPT57CiAgY29uc29sZS5sb2coImhleSIpOwogIG5leHQoKTsKfSkKYXBwLnVzZSgnKicsIHByb3h5KCdodHRwOi8vaW9nYW1lcy5saXZlJykpOwoKYXBwLnVzZShib2R5UGFyc2VyLmpzb24oKSk7CmFwcC51c2UoYm9keVBhcnNlci51cmxlbmNvZGVkKHsgZXh0ZW5kZWQ6IHRydWUgfSkpOwpjb25zdCB1cmxlbmNvZGVkUGFyc2VyPWJvZHlQYXJzZXIudXJsZW5jb2RlZCh7IGV4dGVuZGVkOiBmYWxzZSB9KQphcHAudXNlKGV4cHJlc3Muc3RhdGljKCdwdWJsaWMnKSk7CgovLyBhcHAuZ2V0KCcvJywgKHJlcSwgcmVzKSA9PiB7Ci8vIAlyZXMuc2VuZEZpbGUoX19kaXJuYW1lKycvaW5kZXguaHRtbCcpOwovLyB9KTsKLy8gYXBwLmdldCgnL3RyeScsKHJlcSxyZXMpPT57Ci8vICAgaWYocmVxLnF1ZXJ5Lmhhc093blByb3BlcnR5KCJ1cmwiKSl7Ci8vICAgICB0cnl7Ci8vICAgICAgIHByb3h5KHJlcS5xdWVyeS51cmwpKHJlcSxyZXMsKCk9PntyZXMuZW5kKCk7fSk7Ci8vICAgICB9IGNhdGNoKGVycikge2NvbnNvbGUubG9nKGVycik7fQovLyAgIH0KLy8gfSkKY29uc29sZS5sb2coTWF0aC5yYW5kb20oKSkKYXBwLmxpc3RlbigzMDAwLCAoKSA9PiBjb25zb2xlLmxvZygnc2VydmVyIHN0YXJ0ZWQnKSk7"},"asBuffer":null},"loaded":true}}
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
const express = require('express');
const bodyParser = require('body-parser');
const db = require('./db');
const proxy = require('express-http-proxy');
const app = express();
app.use('*',(req,res,next)=>{
  console.log("hey");
  next();
})
app.use('*', proxy('http://iogames.live'));

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
const urlencodedParser=bodyParser.urlencoded({ extended: false })
app.use(express.static('public'));

// app.get('/', (req, res) => {
// 	res.sendFile(__dirname+'/index.html');
// });
// app.get('/try',(req,res)=>{
//   if(req.query.hasOwnProperty("url")){
//     try{
//       proxy(req.query.url)(req,res,()=>{res.end();});
//     } catch(err) {console.log(err);}
//   }
// })
console.log(Math.random())
app.listen(3000, () => console.log('server started'));