增加打包

main
rustdreamer 2 years ago
parent b56ef772e5
commit 26b7655e32

@ -25,6 +25,8 @@ RUN ls
COPY production.env production.env
COPY production.env development.env
# Run the container under "node" user by default
RUN mkdir apk
COPY ./apk/app.apk apk/app.apk
USER node
CMD [ "node", "main.js" ]

Binary file not shown.

@ -1,4 +1,4 @@
import { BadRequestException, Body, Controller, Get, Post, Put, Query, Req } from '@nestjs/common';
import { BadRequestException, Body, Controller, Get, Post, Put, Query, Req, Res } from '@nestjs/common';
import { AppService } from './app.service';
import * as fs from 'fs';
import { ApiBearerAuth, ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
@ -13,6 +13,7 @@ import { InjectRepository } from '@nestjs/typeorm';
import axios from 'axios';
import { v4 as uuid } from 'uuid';
import { verificationService } from './lib/face';
import { join } from 'path';
export class Electronics {
@ApiProperty({ description: "电子产品名称" })
@ -584,4 +585,25 @@ export class AppController {
};
}
}
@Get('version.json')
async version(
@Req() req: any,
): Promise<any> {
return {
"versionName":"1.1.2",
"apkUrl":`http://${process.env.LOCAL_IP}/app.apk`,
"forceUpdate": false,
"whatsNew": "新版本更新"
};
}
@Get('app.apk')
async file(
@Res() res: any,
): Promise<any> {
const file_path = join(__dirname, "./apk/app.apk")
res.sendFile(file_path)
}
}

Loading…
Cancel
Save