2 Star 1 Fork 0

hailong/debezium-ui

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
serve.js 979 Bytes
一键复制 编辑 原始数据 按行查看 历史
const express = require('express');
const path = require('path');
const fs = require('fs');
const config = require('./config'); // Import the configuration file
const app = express();
// Serve static files
app.use(express.static(path.join(__dirname, 'dist')));
// Endpoint to get configuration
app.get('/config', (req, res) => {
res.setHeader('Content-Type', 'application/json');
console.log("API request made", config.KAFKA_CONNECT_CLUSTERS);
res.json(config);
});
// Watch for changes in the environment variable
fs.watchFile('./config.js', (curr, prev) => {
delete require.cache[require.resolve('./config')];
const updatedConfig = require('./config');
console.log('Configuration updated:', updatedConfig);
});
// Handle other routes
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'));
});
const port = process.env.PORT || 3000;
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/andy001/debezium-ui.git
git@gitee.com:andy001/debezium-ui.git
andy001
debezium-ui
debezium-ui
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385