Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ocm-engine
Manage
Activity
Members
Labels
Plan
Issues
27
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor 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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
svdh
ocm-engine
Commits
efb63a9b
Commit
efb63a9b
authored
1 year ago
by
Zdravko Iliev
Browse files
Options
Downloads
Patches
Plain Diff
fix: separate swagger generation from server run
parent
67d4285e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!46
fix: separate swagger generation from server run
Pipeline
#67390
waiting for manual action with stages
in 11 minutes and 31 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.env.example
+1
-0
1 addition, 0 deletions
.env.example
apps/agent/src/main.ts
+12
-8
12 additions, 8 deletions
apps/agent/src/main.ts
apps/gateway/src/main.ts
+13
-9
13 additions, 9 deletions
apps/gateway/src/main.ts
with
26 additions
and
17 deletions
.env.example
+
1
−
0
View file @
efb63a9b
...
...
@@ -35,3 +35,4 @@ ATTESTATION_SERVICE_HOST=0.0.0.0
PROOF_SERVICE_TCP_PORT=8884
PROOF_SERVICE_HOST=0.0.0.0
SWAGGER=false
This diff is collapsed.
Click to expand it.
apps/agent/src/main.ts
+
12
−
8
View file @
efb63a9b
...
...
@@ -17,15 +17,19 @@ async function bootstrap() {
const
port
=
process
.
env
.
AGENT_PORT
||
3001
;
app
.
enableShutdownHooks
();
const
config
=
new
DocumentBuilder
()
.
setTitle
(
"
Agent
"
)
.
setDescription
(
"
Agent API
"
)
.
setVersion
(
"
1.0
"
)
.
build
();
if
(
process
.
env
.
SWAGGER
===
"
true
"
)
{
const
config
=
new
DocumentBuilder
()
.
setTitle
(
"
Agent
"
)
.
setDescription
(
"
Agent API
"
)
.
setVersion
(
"
1.0
"
)
.
build
();
const
document
=
SwaggerModule
.
createDocument
(
app
,
config
);
fs
.
writeFileSync
(
"
./agent-swagger.json
"
,
JSON
.
stringify
(
document
));
SwaggerModule
.
setup
(
"
api
"
,
app
,
document
);
const
document
=
SwaggerModule
.
createDocument
(
app
,
config
);
fs
.
writeFileSync
(
"
./agent-swagger.json
"
,
JSON
.
stringify
(
document
));
SwaggerModule
.
setup
(
"
api
"
,
app
,
document
);
Logger
.
log
(
`Swagger file written`
);
return
process
.
kill
(
0
);
}
await
app
.
listen
(
port
,
"
0.0.0.0
"
);
Logger
.
log
(
...
...
This diff is collapsed.
Click to expand it.
apps/gateway/src/main.ts
+
13
−
9
View file @
efb63a9b
...
...
@@ -38,17 +38,21 @@ async function bootstrap() {
app
.
enableShutdownHooks
();
const
config
=
new
DocumentBuilder
()
.
setTitle
(
"
OCM Gateway
"
)
.
setDescription
(
"
OCM ENGINE GATEWAY API
"
)
.
setVersion
(
"
1.0
"
)
.
addServer
(
`http://
${
gatewayConfig
.
host
}
:
${
gatewayConfig
.
httpPort
}
`
)
.
build
();
if
(
process
.
env
.
SWAGGER
===
"
true
"
)
{
const
config
=
new
DocumentBuilder
()
.
setTitle
(
"
OCM Gateway
"
)
.
setDescription
(
"
OCM ENGINE GATEWAY API
"
)
.
setVersion
(
"
1.0
"
)
.
addServer
(
`http://
${
gatewayConfig
.
host
}
:
${
gatewayConfig
.
httpPort
}
`
)
.
build
();
const
document
=
SwaggerModule
.
createDocument
(
app
,
config
);
fs
.
writeFileSync
(
"
./gateway-swagger.json
"
,
JSON
.
stringify
(
document
));
SwaggerModule
.
setup
(
"
api
"
,
app
,
document
);
const
document
=
SwaggerModule
.
createDocument
(
app
,
config
);
fs
.
writeFileSync
(
"
./gateway-swagger.json
"
,
JSON
.
stringify
(
document
));
SwaggerModule
.
setup
(
"
api
"
,
app
,
document
);
Logger
.
log
(
`Swagger file written`
);
return
process
.
kill
(
0
);
}
const
port
=
gatewayConfig
.
httpPort
||
3000
;
await
app
.
listen
(
port
,
gatewayConfig
.
host
);
...
...
This diff is collapsed.
Click to expand it.
GITLAB_TOKEN
@project_662_bot2
mentioned in commit
d4921a80
·
1 year ago
mentioned in commit
d4921a80
mentioned in commit d4921a805114de7e26540333e685fd6e693bac8e
Toggle commit list
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