Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-serivce
/
audio-text
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit bdf0487d
authored
May 28, 2024
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交
1 parent
f7d5037f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
app.js
app.js
View file @
bdf0487
...
@@ -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:0
0:13
* @LastEditTime: 2024-05-28 17:0
9: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
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment