Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DojoBackendAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dojo Project (HES-SO)
Projects
Backend
DojoBackendAPI
Commits
3bbb8610
Commit
3bbb8610
authored
1 year ago
by
joel.vonderwe
Browse files
Options
Downloads
Patches
Plain Diff
Add sonar route to check if ti is enabled
parent
54c0e2bf
No related branches found
No related tags found
No related merge requests found
Pipeline
#29895
passed
1 year ago
Stage: code_quality
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ExpressAPI/assets/OpenAPI/OpenAPI.yaml
+25
-0
25 additions, 0 deletions
ExpressAPI/assets/OpenAPI/OpenAPI.yaml
ExpressAPI/src/routes/BaseRoutes.ts
+9
-0
9 additions, 0 deletions
ExpressAPI/src/routes/BaseRoutes.ts
ExpressAPI/src/shared
+1
-1
1 addition, 1 deletion
ExpressAPI/src/shared
with
35 additions
and
1 deletion
ExpressAPI/assets/OpenAPI/OpenAPI.yaml
+
25
−
0
View file @
3bbb8610
...
...
@@ -48,6 +48,31 @@ paths:
description
:
OK
default
:
$ref
:
'
#/components/responses/ERROR'
/sonar
:
get
:
tags
:
-
General
summary
:
Check sonar status
description
:
This route can be used to check if the server supports sonar and if the integration is enabled.
responses
:
'
200'
:
content
:
application/json
:
schema
:
allOf
:
-
$ref
:
'
#/components/schemas/DojoBackendResponse'
-
type
:
object
properties
:
data
:
type
:
object
properties
:
sonarEnabled
:
type
:
boolean
examples
:
-
true
description
:
OK
default
:
$ref
:
'
#/components/responses/ERROR'
/login
:
post
:
tags
:
...
...
This diff is collapsed.
Click to expand it.
ExpressAPI/src/routes/BaseRoutes.ts
+
9
−
0
View file @
3bbb8610
...
...
@@ -2,12 +2,14 @@ import { Express } from 'express-serve-static-core';
import
express
from
'
express
'
;
import
{
StatusCodes
}
from
'
http-status-codes
'
;
import
RoutesManager
from
'
../express/RoutesManager
'
;
import
SharedConfig
from
'
../shared/config/SharedConfig
'
;
class
BaseRoutes
implements
RoutesManager
{
registerOnBackend
(
backend
:
Express
)
{
backend
.
get
(
'
/
'
,
this
.
homepage
.
bind
(
this
));
backend
.
get
(
'
/health_check
'
,
this
.
healthCheck
.
bind
(
this
));
backend
.
get
(
'
/sonar
'
,
this
.
sonar
.
bind
(
this
));
}
private
async
homepage
(
req
:
express
.
Request
,
res
:
express
.
Response
)
{
...
...
@@ -17,6 +19,13 @@ class BaseRoutes implements RoutesManager {
private
async
healthCheck
(
req
:
express
.
Request
,
res
:
express
.
Response
)
{
return
req
.
session
.
sendResponse
(
res
,
StatusCodes
.
OK
);
}
private
async
sonar
(
req
:
express
.
Request
,
res
:
express
.
Response
)
{
const
data
=
{
sonarEnabled
:
SharedConfig
.
useSonar
};
return
req
.
session
.
sendResponse
(
res
,
StatusCodes
.
OK
,
data
);
}
}
...
...
This diff is collapsed.
Click to expand it.
shared
@
d509efa1
Compare
9e3f29d2
...
d509efa1
Subproject commit
9e3f29d2f313ef96944a199da0db39f1827c496a
Subproject commit
d509efa1b35e100446ace49d8e665ca72e5a7afe
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment