Commit bdf0487d by 胡悦

提交

1 parent f7d5037f
Showing 1 changed file with 2 additions and 6 deletions
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2024-05-23 17:35:22 * @Date: 2024-05-23 17:35:22
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2024-05-28 17:00:13 * @LastEditTime: 2024-05-28 17:09:19
*/ */
'use strict'; 'use strict';
const express = require("express"); const express = require("express");
...@@ -19,7 +19,6 @@ const upload = multer({ dest: 'uploads/' }); // 设置上传文件的存储路 ...@@ -19,7 +19,6 @@ const upload = multer({ dest: 'uploads/' }); // 设置上传文件的存储路
app.use(express.static('public')); // 提供静态文件服务 app.use(express.static('public')); // 提供静态文件服务
// 上传文件 // 上传文件
app.post('/upload', upload.single('file'), (req, res) => { app.post('/upload', upload.single('file'), (req, res) => {
console.log(req.file, '======')
if (req.file) { if (req.file) {
res.send(req.file.path); res.send(req.file.path);
} else { } else {
...@@ -28,7 +27,6 @@ app.post('/upload', upload.single('file'), (req, res) => { ...@@ -28,7 +27,6 @@ app.post('/upload', upload.single('file'), (req, res) => {
}); });
// 转化文字 // 转化文字
app.post('/fileTrans', (req, res) => { app.post('/fileTrans', (req, res) => {
console.log(req.body, '========')
let fileLink = '' let fileLink = ''
if (req.body && req.body.fileLink) { if (req.body && req.body.fileLink) {
fileLink = req.body.fileLink fileLink = req.body.fileLink
...@@ -48,6 +46,4 @@ app.post('/fileTrans', (req, res) => { ...@@ -48,6 +46,4 @@ app.post('/fileTrans', (req, res) => {
} }
}); });
}); });
app.listen(port, () => {
console.log(`服务器运行在 http://localhost:${port}`);
});
\ No newline at end of file \ No newline at end of file
app.listen(port);
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!