| 123456789101112131415161718192021222324 |
- const express = require('express');
- const path = require('path');
- const app = express();
- const { getLocale } = require('./libs/utils');
- // 设置视图引擎为EJS
- app.set('view engine', 'ejs');
- // 设置视图目录
- app.set('views', path.join(__dirname, 'views'));
- app.use(express.static(path.join(__dirname, 'dist')));
- app.use('/', require('./routes/index'));
- app.use('/proxy', require('./routes/proxy'));
- // 启动服务器,监听3000端口
- const PORT = process.env.PORT || 3000;
- app.listen(PORT, () => {
- console.log(`Server is running on http://localhost:${PORT}`);
- });
|