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 ef76f70d
authored
May 29, 2024
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复
1 parent
8b20b763
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
app.js
package.json
app.js
View file @
ef76f70
...
@@ -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-29 1
6:31:04
* @LastEditTime: 2024-05-29 1
7:01:32
*/
*/
'use strict'
;
'use strict'
;
const
ALIYUN_AK_ID
=
'LTAI5t8m8DpaffMDhR8YWqWz'
const
ALIYUN_AK_ID
=
'LTAI5t8m8DpaffMDhR8YWqWz'
...
@@ -13,7 +13,7 @@ const NLS_APP_KEY = 'wtWTUAwcMbuf60NY'
...
@@ -13,7 +13,7 @@ const NLS_APP_KEY = 'wtWTUAwcMbuf60NY'
const
express
=
require
(
"express"
);
const
express
=
require
(
"express"
);
const
app
=
express
();
const
app
=
express
();
const
path
=
require
(
"path"
);
const
path
=
require
(
"path"
);
const
port
=
process
.
argv
[
4
]
||
3000
;
const
port
=
process
.
argv
[
3
]
||
3000
;
const
fileTrans
=
require
(
'./fileTrans'
);
const
fileTrans
=
require
(
'./fileTrans'
);
require
(
'dotenv'
).
config
();
require
(
'dotenv'
).
config
();
app
.
use
(
require
(
'body-parser'
).
urlencoded
({
extended
:
false
}))
app
.
use
(
require
(
'body-parser'
).
urlencoded
({
extended
:
false
}))
...
@@ -22,15 +22,13 @@ const multer = require('multer');
...
@@ -22,15 +22,13 @@ const multer = require('multer');
app
.
use
(
express
.
json
())
app
.
use
(
express
.
json
())
app
.
use
(
express
.
urlencoded
({
extended
:
true
}));
// 表示form-data中普通数据的处理,不能用于文件的处理
app
.
use
(
express
.
urlencoded
({
extended
:
true
}));
// 表示form-data中普通数据的处理,不能用于文件的处理
// app.use(upload.any())
// app.use(upload.any())
console
.
log
(
process
.
argv
,
process
.
argv
[
4
])
console
.
log
(
process
.
argv
,
process
.
argv
[
3
])
app
.
use
(
express
.
static
(
'public'
));
// 提供静态文件服务
app
.
use
(
express
.
static
(
'public'
));
// 提供静态文件服务
// 为上传的文件添加后缀和文件名
// 为上传的文件添加后缀和文件名
const
storage
=
multer
.
diskStorage
({
const
storage
=
multer
.
diskStorage
({
destination
:
function
(
req
,
file
,
cb
)
{
destination
:
'./uploads/'
,
cb
(
null
,
'uploads/'
)
},
filename
:
function
(
req
,
file
,
cb
)
{
filename
:
function
(
req
,
file
,
cb
)
{
cb
(
null
,
Date
.
now
()
+
path
.
extname
(
file
.
originalname
))
cb
(
null
,
Date
.
now
()
+
path
.
extname
(
file
.
originalname
))
}
}
...
...
package.json
View file @
ef76f70
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
"main"
:
"index.js"
,
"main"
:
"index.js"
,
"scripts"
:
{
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
,
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
,
"start"
:
"node app.js --port
$npm_package_config_port
"
"start"
:
"node app.js --port"
},
},
"keywords"
:
[],
"keywords"
:
[],
"author"
:
""
,
"author"
:
""
,
...
...
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