const express = require('express'); const cors = require ('cors') const app = express(); app.use(cors()); app.use(express.json()); app.use(express.urlencoded({ extended: true })); app.get('/', function (req, res) { var real_ip = req.get("X-Real-IP") || req.get("X-Forwarded-For") || req.ip; console.log("get,host:%s, ip:%s,date:%s",req.hostname,real_ip,new Date()); res.send('Hello World'); }) app.post('/', function (req, res) { var real_ip = req.get("X-Real-IP") || req.get("X-Forwarded-For") || req.ip; console.log("post,host:%s, ip:%s,date:%s",req.hostname,real_ip,new Date()); res.send('Hello World'); }) app.use('/', require("./get_role_info")); app.use('/', require("./get_server_info")); app.use('/', require("./get_server_list")); exports.app = app;