init: 微信支付 Native 页面 (Express + JSON 存储)

This commit is contained in:
2026-07-12 14:44:44 +08:00
commit d46977be14
13 changed files with 2392 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
const express = require('express');
const path = require('path');
const config = require('./config');
const app = express();
// Body parsing
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
app.use(express.text({ type: ['text/xml', 'application/xml'] }));
// Static files
app.use(express.static(path.join(__dirname, 'public')));
// View engine
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, 'views'));
// Routes
app.use('/', require('./routes/index'));
app.use('/pay', require('./routes/pay'));
// Start server
app.listen(config.server.port, config.server.host, () => {
console.log(`Server running at http://localhost:${config.server.port}`);
});