Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
LINAGORA
L
LGS
Labs
linstt-controller
Commits
6eeb79a8
Commit
6eeb79a8
authored
Jan 23, 2018
by
Yoann HOUPERT
Browse files
manage env variable from docker
parent
efa73fde
Pipeline
#10157
passed with stage
in 1 minute and 15 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
config.json
config.json
+2
-2
lib/controller/offline.js
lib/controller/offline.js
+6
-1
lib/webserver/routes.js
lib/webserver/routes.js
+3
-6
No files found.
config.json
View file @
6eeb79a8
...
...
@@ -11,8 +11,8 @@
}
},
"offline"
:
{
"host"
:
"linsttpoc_offline_1"
,
"port"
:
"
5000
"
,
"host"
:
"linsttpoc_offline
-server
_1"
,
"port"
:
"
8888
"
,
"api"
:
{
"upload"
:
"upload"
}
...
...
lib/controller/offline.js
View file @
6eeb79a8
...
...
@@ -24,7 +24,12 @@ module.exports = config => {
return
{
transcript
:
(
wavFile
,
enhancementlCallback
)
=>
{
const
url
=
'
http://
'
+
config
.
host
+
'
:
'
+
config
.
port
+
'
/
'
+
config
.
api
.
upload
;
let
port
=
config
.
port
;
if
(
process
.
env
.
OFFLINE_PORT
!==
undefined
)
{
port
=
process
.
env
.
OFFLINE_PORT
;
}
const
url
=
'
http://
'
+
config
.
host
+
'
:
'
+
port
+
'
/
'
+
config
.
api
.
upload
;
const
uiid
=
uuidv1
();
let
myUuidString
=
uiid
.
toString
();
...
...
lib/webserver/routes.js
View file @
6eeb79a8
...
...
@@ -44,7 +44,7 @@ const routesFactory = config => {
return
res
.
status
(
interalServerCode
).
json
({
module
:
'
Enhancement
'
,
error
:
'
Error during audio enhancing
'
});
}
if
(
config
.
isOffline
)
{
if
(
process
.
env
.
IS_OFFLINE
===
'
true
'
||
(
process
.
env
.
IS_OFFLINE
===
undefined
&&
config
.
isOffline
===
true
)
)
{
offline
.
transcript
(
body
,
(
err
,
response
,
body
)
=>
{
if
(
err
)
{
return
res
.
status
(
interalServerCode
).
json
({
module
:
'
Offline transcription
'
,
error
:
'
Error during audio transcription
'
,
info
:
err
.
toString
()});
...
...
@@ -57,10 +57,7 @@ const routesFactory = config => {
return
res
.
status
(
interalServerCode
).
json
({
module
:
'
Offline transcription
'
,
error
:
'
Error during audio transcription
'
});
}
// Default Offline
const
transcription
=
json
.
transcript
;
// TODO use this when enhancement whill be integrate
// const transcription = JSON.parse(json.transcript).transcript
const
transcription
=
JSON
.
parse
(
json
.
transcript
).
transcript
;
const
jsonResponse
=
{
status
:
0
,
...
...
@@ -70,7 +67,7 @@ const routesFactory = config => {
id
:
uuidv1
()
};
return
res
.
status
(
200
).
json
({
message
:
'
t
ranscript done
'
,
transcript
:
jsonResponse
});
return
res
.
status
(
200
).
json
({
message
:
'
T
ranscript done
'
,
transcript
:
jsonResponse
});
});
}
else
{
stt
.
transcript
(
body
,
(
err
,
response
,
body
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment