@pluginarch/create-parch
Version:
this is way to create a ui project
33 lines (26 loc) • 895 B
JavaScript
const express = require('express');
const path = require('path');
const app = express();
const PORT = process.env.PORT || 3000;
// 设置静态文件目录为 "public"
app.use(express.static(path.join(__dirname, './dist')));
// 当没有匹配到其他路由时,返回 index.html
app.get('*', (req, res) => {
console.log('res:'+res)
res.sendFile(path.resolve(__dirname, '', './dist/index.html'));
});
app.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);
});
// const pluginManager = new PluginManager();
// pluginManager.loadPlugin(MyPlugin); // 加载插件
// app.get('/', (req, res) => {
// const pageAttributes = {
// title: 'My Page',
// content: '<p>Hello, World!</p>',
// styles: {
// color: 'blue',
// fontSize: '16px'
// }
// };
// });