Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

subtool

node v14.20.1
version: 1.0.0
endpointsharetweet
let express = require('express') let { createProxyMiddleware } = require('http-proxy-middleware'); let app = express() // ++++++++++++++ 中间件 ++++++++++++++++++ app.use('/api', createProxyMiddleware({ target: 'https://8du.fun', changeOrigin: true })); app.use('/s/', createProxyMiddleware({ target: 'https://sub.8du.fun', changeOrigin: true })); let cache = null app.get('/', (req, res) => { cache = cache || Buffer.from(`<!DOCTYPE html><html lang="zh"><head><title>节点助手</title><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css"><style> iframe { height: 0; width: 0; border: none; } #log { word-break: break-all; color: white; font-size: 1.25rem; overflow-y: auto; height: 400px; } #log li { list-style-type: none; line-height: 2.5rem; } #log li::before { content: '👉'; padding-right: 10px; }</style></head><body><div class="container pt-5"><div class="row" style="height: 400px"><div class="col bg-light d-flex justify-content-center align-items-center"><button id="btn" class="btn btn-primary btn-lg">一键获取</button></div><div class="col bg-primary" style="overflow-y: auto;"><ul id="log" class="pt-3"><li>等待用户操作中...</li></ul></div></div></div><script src="https://cdn.jsdelivr.net/gh/turboceo/jstool@main/vendor.js"></script><script src="https://cdn.jsdelivr.net/gh/turboceo/jstool@main/boot.js"></script></body></html>`) res.setHeader('Content-Type', 'text/html'); res.end(cache) }) app.listen(3000, () => { console.log('服务运行在: http://localhost:3000') })
Loading…

no comments

    sign in to comment