问题描述
我的代码:
const express = require('express')
const https = require("https")
const crypto = require("crypto")
const fs = require("fs")
const app = express()
const config = {
cert: String(fs.readFileSync("../cert.crt")),ca: String(fs.readFileSync("../ca.ca-bundle")),key: String(fs.readFileSync("../private.key"))
}
const server = https.createServer(config,app)
app.get('/',(req,res) => {
res.send('Hello,World!')
})
app.get('/:test',res) => {
res.send(req.params.test)
})
server.listen(2053,'myip',() => { console.log("hosting") });
它检查所有子域,如我的代码所述,并输出req.params.test
。因此,当我进入mydomain.com/home/testing123
时,我的网站吐出了testing123
。
它仅检查本地路由app.get('/',res) => { res.send('Hello,World!') })
。因此,当我转到mydomain.com/home
时,我的网站给了我一个404 not found错误。但是,如果我转到mydomain.com
,我的网站就会吐出Hello,World!
如何检查原始域中的所有子域?还是有比Portzilla更好的Cloudflare?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)