Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
d15ddb49
Unverified
Commit
d15ddb49
authored
Dec 17, 2018
by
chicm-ms
Committed by
GitHub
Dec 17, 2018
Browse files
Download log (#478)
* Support download log files * updates
parent
d1008bb3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/nni_manager/rest_server/nniRestServer.ts
src/nni_manager/rest_server/nniRestServer.ts
+4
-1
No files found.
src/nni_manager/rest_server/nniRestServer.ts
View file @
d15ddb49
...
@@ -19,11 +19,12 @@
...
@@ -19,11 +19,12 @@
'
use strict
'
;
'
use strict
'
;
import
*
as
express
from
'
express
'
;
import
*
as
bodyParser
from
'
body-parser
'
;
import
*
as
bodyParser
from
'
body-parser
'
;
import
*
as
express
from
'
express
'
;
import
*
as
path
from
'
path
'
;
import
*
as
path
from
'
path
'
;
import
*
as
component
from
'
../common/component
'
;
import
*
as
component
from
'
../common/component
'
;
import
{
RestServer
}
from
'
../common/restServer
'
import
{
RestServer
}
from
'
../common/restServer
'
import
{
getLogDir
}
from
'
../common/utils
'
;
import
{
createRestHandler
}
from
'
./restHandler
'
;
import
{
createRestHandler
}
from
'
./restHandler
'
;
/**
/**
...
@@ -35,6 +36,7 @@ import { createRestHandler } from './restHandler';
...
@@ -35,6 +36,7 @@ import { createRestHandler } from './restHandler';
@
component
.
Singleton
@
component
.
Singleton
export
class
NNIRestServer
extends
RestServer
{
export
class
NNIRestServer
extends
RestServer
{
private
readonly
API_ROOT_URL
:
string
=
'
/api/v1/nni
'
;
private
readonly
API_ROOT_URL
:
string
=
'
/api/v1/nni
'
;
private
readonly
LOGS_ROOT_URL
:
string
=
'
/logs
'
;
/**
/**
* constructor to provide NNIRestServer's own rest property, e.g. port
* constructor to provide NNIRestServer's own rest property, e.g. port
...
@@ -50,6 +52,7 @@ export class NNIRestServer extends RestServer {
...
@@ -50,6 +52,7 @@ export class NNIRestServer extends RestServer {
this
.
app
.
use
(
express
.
static
(
'
static
'
));
this
.
app
.
use
(
express
.
static
(
'
static
'
));
this
.
app
.
use
(
bodyParser
.
json
());
this
.
app
.
use
(
bodyParser
.
json
());
this
.
app
.
use
(
this
.
API_ROOT_URL
,
createRestHandler
(
this
));
this
.
app
.
use
(
this
.
API_ROOT_URL
,
createRestHandler
(
this
));
this
.
app
.
use
(
this
.
LOGS_ROOT_URL
,
express
.
static
(
getLogDir
()));
this
.
app
.
get
(
'
*
'
,
(
req
:
express
.
Request
,
res
:
express
.
Response
)
=>
{
this
.
app
.
get
(
'
*
'
,
(
req
:
express
.
Request
,
res
:
express
.
Response
)
=>
{
res
.
sendFile
(
path
.
resolve
(
'
static/index.html
'
));
res
.
sendFile
(
path
.
resolve
(
'
static/index.html
'
));
});
});
...
...
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