Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ehasa-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
WIMMA Lab 2019
Overflow
ehasa-backend
Commits
ecf20265
Commit
ecf20265
authored
5 years ago
by
L4168
Browse files
Options
Downloads
Patches
Plain Diff
use controller to serve images
parent
1b8b320b
No related branches found
Branches containing commit
No related tags found
3 merge requests
!59
Development to master
,
!58
Development to testing
,
!56
Cluster update to Development
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/game/game.controller.ts
+6
-0
6 additions, 0 deletions
src/game/game.controller.ts
src/game/game.dto.ts
+2
-0
2 additions, 0 deletions
src/game/game.dto.ts
src/main.ts
+1
-4
1 addition, 4 deletions
src/main.ts
with
9 additions
and
4 deletions
src/game/game.controller.ts
+
6
−
0
View file @
ecf20265
...
...
@@ -11,6 +11,7 @@ import {
ClassSerializerInterceptor
,
Delete
,
UploadedFile
,
Res
,
}
from
'
@nestjs/common
'
;
import
{
FileInterceptor
}
from
'
@nestjs/platform-express
'
;
import
{
diskStorage
}
from
'
multer
'
;
...
...
@@ -126,4 +127,9 @@ export class GameController {
uploadImage
(@
UploadedFile
()
image
)
{
return
image
;
}
@
Get
(
'
images/:img
'
)
returnImage
(@
Param
(
'
img
'
)
image
,
@
Res
()
res
)
{
return
res
.
sendFile
(
image
,
{
root
:
'
images
'
});
}
}
This diff is collapsed.
Click to expand it.
src/game/game.dto.ts
+
2
−
0
View file @
ecf20265
...
...
@@ -73,6 +73,8 @@ export class newGameDTO {
enddate
:
string
;
@
Length
(
0
,
65
)
image
:
string
;
@
Allow
()
map
?:
JSON
;
}
export
class
GameStateDTO
{
...
...
This diff is collapsed.
Click to expand it.
src/main.ts
+
1
−
4
View file @
ecf20265
import
{
NestFactory
}
from
'
@nestjs/core
'
;
import
{
NestExpressApplication
}
from
'
@nestjs/platform-express
'
;
import
{
join
}
from
'
path
'
;
import
{
AppModule
}
from
'
./app.module
'
;
...
...
@@ -9,10 +7,9 @@ import { AppModule } from './app.module';
*/
async
function
bootstrap
()
{
const
app
=
await
NestFactory
.
create
<
NestExpressApplication
>
(
AppModule
);
const
app
=
await
NestFactory
.
create
(
AppModule
);
// Cors is needed for application/json POST
app
.
enableCors
();
app
.
useStaticAssets
(
join
(
__dirname
,
'
..
'
,
'
images
'
));
await
app
.
listen
(
5000
);
}
bootstrap
();
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