Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
console
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
MyCard
console
Commits
c38daeb8
Commit
c38daeb8
authored
Aug 20, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serve static and header
parent
e8298003
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
3 deletions
+44
-3
Dockerfile
Dockerfile
+1
-2
console-api/package-lock.json
console-api/package-lock.json
+33
-0
console-api/package.json
console-api/package.json
+1
-0
console-api/src/app.module.ts
console-api/src/app.module.ts
+5
-0
console-api/src/update/update.controller.ts
console-api/src/update/update.controller.ts
+4
-1
No files found.
Dockerfile
View file @
c38daeb8
...
...
@@ -20,7 +20,6 @@ WORKDIR /app
COPY
--from=api /app/package*.json ./
RUN
npm ci
COPY
--from=api /app/dist dist
COPY
--from=api /app/views views
COPY
--from=web /app/dist/console-web public
CMD
["npm", "run", "start:prod"]
VOLUME
/app/config
\ No newline at end of file
console-api/package-lock.json
View file @
c38daeb8
...
...
@@ -14,6 +14,7 @@
"@nestjs/config"
:
"^1.0.1"
,
"@nestjs/core"
:
"^8.0.0"
,
"@nestjs/platform-express"
:
"^8.0.0"
,
"@nestjs/serve-static"
:
"^2.2.2"
,
"@nestjs/swagger"
:
"^5.0.9"
,
"@nestjs/typeorm"
:
"^8.0.2"
,
"axios"
:
"^0.21.1"
,
...
...
@@ -2847,6 +2848,23 @@
"integrity"
:
"sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
,
"dev"
:
true
},
"node_modules/@nestjs/serve-static"
:
{
"version"
:
"2.2.2"
,
"resolved"
:
"https://registry.npmjs.org/@nestjs/serve-static/-/serve-static-2.2.2.tgz"
,
"integrity"
:
"sha512-3Mr+Q/npS3N7iGoF3Wd6Lj9QcjMGxbNrSqupi5cviM0IKrZ1BHl5qekW95rWYNATAVqoTmjGROAq+nKKpuUagQ=="
,
"dependencies"
:
{
"path-to-regexp"
:
"0.1.7"
},
"peerDependencies"
:
{
"@nestjs/common"
:
"^6.0.0 || ^7.0.0 || ^8.0.0"
,
"@nestjs/core"
:
"^6.0.0 || ^7.0.0 || ^8.0.0"
}
},
"node_modules/@nestjs/serve-static/node_modules/path-to-regexp"
:
{
"version"
:
"0.1.7"
,
"resolved"
:
"https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz"
,
"integrity"
:
"sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"node_modules/@nestjs/swagger"
:
{
"version"
:
"5.0.9"
,
"resolved"
:
"https://registry.npmjs.org/@nestjs/swagger/-/swagger-5.0.9.tgz"
,
...
...
@@ -13840,6 +13858,21 @@
}
}
},
"@nestjs/serve-static"
:
{
"version"
:
"2.2.2"
,
"resolved"
:
"https://registry.npmjs.org/@nestjs/serve-static/-/serve-static-2.2.2.tgz"
,
"integrity"
:
"sha512-3Mr+Q/npS3N7iGoF3Wd6Lj9QcjMGxbNrSqupi5cviM0IKrZ1BHl5qekW95rWYNATAVqoTmjGROAq+nKKpuUagQ=="
,
"requires"
:
{
"path-to-regexp"
:
"0.1.7"
},
"dependencies"
:
{
"path-to-regexp"
:
{
"version"
:
"0.1.7"
,
"resolved"
:
"https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz"
,
"integrity"
:
"sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
}
}
},
"@nestjs/swagger"
:
{
"version"
:
"5.0.9"
,
"resolved"
:
"https://registry.npmjs.org/@nestjs/swagger/-/swagger-5.0.9.tgz"
,
...
...
console-api/package.json
View file @
c38daeb8
...
...
@@ -27,6 +27,7 @@
"@nestjs/config"
:
"^1.0.1"
,
"@nestjs/core"
:
"^8.0.0"
,
"@nestjs/platform-express"
:
"^8.0.0"
,
"@nestjs/serve-static"
:
"^2.2.2"
,
"@nestjs/swagger"
:
"^5.0.9"
,
"@nestjs/typeorm"
:
"^8.0.2"
,
"axios"
:
"^0.21.1"
,
...
...
console-api/src/app.module.ts
View file @
c38daeb8
...
...
@@ -14,11 +14,16 @@ import { Build } from './entities/Build.entity';
import
{
Depot
}
from
'
./entities/Depot.entity
'
;
import
{
UpdateController
}
from
'
./update/update.controller
'
;
import
{
UpdateService
}
from
'
./update/update.service
'
;
import
{
ServeStaticModule
}
from
'
@nestjs/serve-static
'
;
import
path
from
'
path
'
;
const
configModule
=
ConfigModule
.
forRoot
();
@
Module
({
imports
:
[
ServeStaticModule
.
forRoot
({
rootPath
:
path
.
join
(
__dirname
,
'
..
'
,
'
public
'
),
}),
configModule
,
TypeOrmModule
.
forRootAsync
({
name
:
'
app
'
,
...
...
console-api/src/update/update.controller.ts
View file @
c38daeb8
import
{
Body
,
Controller
,
Get
,
Param
,
ParseArrayPipe
,
Post
,
Query
,
Render
,
ValidationPipe
}
from
'
@nestjs/common
'
;
import
{
Body
,
Controller
,
Get
,
Header
,
Param
,
ParseArrayPipe
,
Post
,
Query
,
Render
,
ValidationPipe
}
from
'
@nestjs/common
'
;
import
{
UpdateService
}
from
'
./update.service
'
;
import
{
ApiBody
,
ApiOkResponse
,
ApiOperation
,
ApiParam
,
ApiProperty
,
ApiQuery
,
ApiTags
}
from
'
@nestjs/swagger
'
;
import
{
DepotDto
}
from
'
../dto/Depot.dto
'
;
...
...
@@ -9,6 +9,7 @@ export class UpdateController {
constructor
(
private
readonly
updateService
:
UpdateService
)
{}
@
Get
(
'
apps.json
'
)
@
ApiOperation
({
summary
:
'
获取 apps.json
'
,
description
:
'
懒得解释这是啥了……
'
})
@
Header
(
'
Cache-Control
'
,
'
public, max-age=600
'
)
getAppsJson
()
{
return
this
.
updateService
.
getAppsJson
();
}
...
...
@@ -20,6 +21,7 @@ export class UpdateController {
@
ApiParam
({
name
:
'
version
'
,
description
:
'
APP 的版本号
'
})
@
ApiQuery
({
type
:
DepotDto
,
description
:
'
APP 的类型
'
})
@
ApiOkResponse
({
type
:
String
})
@
Header
(
'
Cache-Control
'
,
'
public, max-age=31536000, immutable
'
)
async
getChecksum
(
@
Param
(
'
id
'
)
id
:
string
,
@
Query
(
new
ValidationPipe
({
transform
:
true
}))
depot
:
DepotDto
,
...
...
@@ -35,6 +37,7 @@ export class UpdateController {
@
ApiParam
({
name
:
'
version
'
,
description
:
'
APP 的版本号
'
})
@
ApiQuery
({
type
:
DepotDto
,
description
:
'
APP 的类型
'
})
@
ApiOkResponse
({
type
:
String
})
@
Header
(
'
Cache-Control
'
,
'
public, max-age=31536000, immutable
'
)
async
getFullPackageMetalink
(
@
Param
(
'
id
'
)
id
:
string
,
@
Query
(
new
ValidationPipe
({
transform
:
true
}))
depot
:
DepotDto
,
...
...
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