Skip to content

Commit

Permalink
[BE] ✨ : 배포를 위한 페이지 제작 (#109)
Browse files Browse the repository at this point in the history
* swagger 설정

* 📝 Express 추가

express 추가해서 html 파일 전송하는 기능 추가

* ✨ 배포를 위한 페이지 구현

배포 시 사용하는 페이지를 만듬
  • Loading branch information
twoo1999 authored Nov 24, 2023
1 parent 9434edf commit e161df4
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 9 deletions.
57 changes: 51 additions & 6 deletions BE/musicspot/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion BE/musicspot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/mongoose": "^10.0.2",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/platform-express": "^10.2.10",
"@nestjs/swagger": "^7.1.15",
"@types/dotenv": "^8.2.0",
"@types/multer": "^1.4.10",
Expand All @@ -32,6 +32,7 @@
"class-validator": "^0.14.0",
"dotenv": "^16.3.1",
"gitmoji-cli": "^9.0.0",
"handlebars": "^4.7.8",
"mongoose": "^8.0.0",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1",
Expand Down
15 changes: 15 additions & 0 deletions BE/musicspot/public/release.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>배포 페이지</title>
</head>
<body>
<a
href="itms-services://?action=download-manifest&amp;url=https://kr.object.ncloudstorage.com/-"
>0.0</a
>
<span>- 배포 2023.11.24</span>
</body>
</html>
4 changes: 3 additions & 1 deletion BE/musicspot/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { JourneyModule } from './journey/module/journey.module';
import { SpotModule } from './spot/module/spot.module';
import { UserModule } from './user/module/user.module';
import * as dotenv from 'dotenv';

import { ReleaseController } from './releasePage/release.controller';
dotenv.config();

@Module({
Expand All @@ -17,7 +19,7 @@ dotenv.config();
UserModule,
SpotModule,
],
controllers: [AppController],
controllers: [AppController, ReleaseController],
providers: [AppService],
})
export class AppModule {}
3 changes: 2 additions & 1 deletion BE/musicspot/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { NestFactory } from '@nestjs/core';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { AppModule } from './app.module';
import { ValidationPipe } from '@nestjs/common';
import { NestExpressApplication } from '@nestjs/platform-express';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const app = await NestFactory.create<NestExpressApplication>(AppModule);
const config = new DocumentBuilder()
.setTitle('Music Spot') // 문서의 제목
.setDescription('iOS01 Music Spot App API') // 문서의 간단한 설명
Expand Down
13 changes: 13 additions & 0 deletions BE/musicspot/src/releasePage/release.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Controller, Get, Render, Res } from '@nestjs/common';
import { Response } from 'express';
import * as fs from 'fs';
import { join } from 'path';
@Controller('release')
export class ReleaseController {
@Get()
sendReleasePage(@Res() res: Response) {
res
.status(200)
.sendFile(join(__dirname, '..', '..', 'public', 'release.html'));
}
}

0 comments on commit e161df4

Please sign in to comment.