Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
I
init-things
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
init-things
Commits
ad37ca6f
Commit
ad37ca6f
authored
Oct 30, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve
parent
4753daf5
Pipeline
#6547
passed with stages
in 1 minute and 59 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
things/nest/install-npm.sh
things/nest/install-npm.sh
+2
-0
things/nest/src/app.module.ts
things/nest/src/app.module.ts
+8
-1
things/nest/src/main.ts
things/nest/src/main.ts
+6
-1
No files found.
things/nest/install-npm.sh
View file @
ad37ca6f
...
...
@@ -3,7 +3,9 @@ npm install --save \
class-validator
\
class-transformer
\
@nestjs/swagger
\
@nestjs/config
\
swagger-ui-express
\
yaml
npm
install
--save-dev
\
@types/express
things/nest/src/app.module.ts
View file @
ad37ca6f
import
{
Module
}
from
'
@nestjs/common
'
;
import
{
AppController
}
from
'
./app.controller
'
;
import
{
AppService
}
from
'
./app.service
'
;
import
{
ConfigModule
}
from
'
@nestjs/config
'
;
import
{
loadConfig
}
from
'
./utility/config
'
;
@
Module
({
imports
:
[],
imports
:
[
ConfigModule
.
forRoot
({
ignoreEnvVars
:
true
,
load
:
[
loadConfig
],
}),
],
controllers
:
[
AppController
],
providers
:
[
AppService
],
})
...
...
things/nest/src/main.ts
View file @
ad37ca6f
...
...
@@ -2,6 +2,7 @@ import { NestFactory } from '@nestjs/core';
import
{
SwaggerModule
,
DocumentBuilder
}
from
'
@nestjs/swagger
'
;
import
{
NestExpressApplication
}
from
'
@nestjs/platform-express
'
;
import
{
AppModule
}
from
'
./app.module
'
;
import
{
ConfigService
}
from
'
@nestjs/config
'
;
async
function
bootstrap
()
{
const
app
=
await
NestFactory
.
create
<
NestExpressApplication
>
(
AppModule
);
...
...
@@ -17,6 +18,10 @@ async function bootstrap() {
const
document
=
SwaggerModule
.
createDocument
(
app
,
documentConfig
);
SwaggerModule
.
setup
(
'
docs
'
,
app
,
document
);
await
app
.
listen
(
3000
);
const
config
=
app
.
get
(
ConfigService
);
await
app
.
listen
(
config
.
get
<
number
>
(
'
port
'
)
||
3000
,
config
.
get
<
string
>
(
'
host
'
)
||
'
::
'
,
);
}
bootstrap
();
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