chenyc
2024-10-29 ee5d1510c87dbf40e532ee41ea88d11d445dce77
更新输出git ;
1个文件已修改
1个文件已添加
43 ■■■■■ 已修改文件
app.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/index.html 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.js
@@ -2,6 +2,7 @@
const bodyParser = require('body-parser');
const mysql = require('mysql2');
const fs = require('fs').promises;
const fs2=require('fs')
const path = require('path');
const moment = require('moment')
// 转成能识别的url
@@ -46,7 +47,14 @@
    return new facebody20191230.default(config);
}
app.get('/',async(req,res)=>{
    res.send('设备交换患者信息333');
    const filePath = path.join(__dirname, 'public', 'index.html');
    fs2.readFile(filePath, 'utf8', (err, data) => {
        if (err) {
        res.status(500).send('Error reading file');
        return;
        }
        res.send(data);
    });
})
// 定义 /webuser 路由处理器  用患者code 换信息
app.post('/webuser', async (req, res) => {
public/index.html
New file
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>聊天机器人</title>
    <style>
        body, html {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        iframe {
            width: 100%;
            height: 100%;
            min-height: 700px;
            border: none;
        }
    </style>
</head>
<body>
    <iframe
        src="https://udify.app/chatbot/irsmISE8DBCWAhxz"
        style="width: 100%; height: 100%; min-height: 700px"
        frameborder="0"
        allow="microphone">
    </iframe>
</body>
</html>