refactor: migrate to Tencent Cloud backend

这个提交包含在:
Guoguo
2026-04-28 22:56:47 +08:00
父节点 267c75718b
当前提交 444c91c0b0
修改 102 个文件,包含 17927 行新增1997 行删除
+27
查看文件
@@ -0,0 +1,27 @@
require('dotenv').config({ path: require('path').join(__dirname, '..', '.env') })
const http = require('http')
const config = require('../src/config')
const { handle } = require('../src/app')
const server = http.createServer(async (req, res) => {
const chunks = []
req.on('data', chunk => chunks.push(chunk))
req.on('end', async () => {
const url = new URL(req.url, 'http://localhost')
const event = {
httpMethod: req.method,
path: url.pathname,
headers: req.headers,
queryStringParameters: Object.fromEntries(url.searchParams.entries()),
body: Buffer.concat(chunks).toString('utf8')
}
const result = await handle(event)
res.writeHead(result.statusCode, result.headers)
res.end(result.body || '')
})
})
server.listen(config.port, () => {
console.log('SCF local server listening on http://localhost:' + config.port)
})