Files
  • index.js
  • db.js
  • db.sqlite3
  • index.html
  • package-lock.json
  • package.json
index.js
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'));