init: 微信支付 Native 页面 (Express + JSON 存储)
This commit is contained in:
@@ -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}`);
|
||||
});
|
||||
Reference in New Issue
Block a user