Skip to content

Commit

Permalink
feat: ipa 제공을 위한 index.html 서빙 코드 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
wonholim committed Nov 20, 2023
1 parent cfd7ada commit d05ff19
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 8 deletions.
90 changes: 90 additions & 0 deletions BackEnd/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>We-Tri Triathlon App Download</title>
<style>
body, html {
height: 100%;
margin: 0;
}
body {
display: flex;
flex-direction: column;
font-family: 'Arial', sans-serif;
background-color: #F6F6FE;
color: #555;
}

header {
background-color: #5F5FF9; /* Main-03 color */
color: white;
padding: 20px 0;
text-align: center;
}

main {
display: flex;
flex-direction: column;
flex: 1;
justify-content: center;
align-items: center;
text-align: center;
}

.app-info {
margin-bottom: 30px;
}

.downloads .download-button {
background-color: #E1E1FA; /* Main-02 color */
color: #333;
padding: 10px 15px;
margin: 10px;
text-decoration: none;
display: inline-block;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

footer {
display: flex;
background-color: #333;
color: white;
padding: 10px 0;
align-items: center;
justify-content: center;
text-align: center;
}

.download-button:hover {
background-color: #5F5FF9; /* Main-01 color */
}
</style>
</head>
<body>
<header>
<h1>We-Tri: 트라이 애슬론을 우리와 함께해요</h1>
</header>
<main>
<section class="app-info">
<p>
이 곳은 데모 앱 설치 화면이에요. 등록되지 않은 분들은 설치할 수
없어요.
</p>
</section>
<section class="downloads">
<a
href="itms-services://?action=download-manifest&amp;url=https://kr.object.ncloudstorage.com/wetri-ios-ipa/iOS/manifest.plist"
class="download-button week-2"
>Download Week 2 App</a
>
<a href="#" class="download-button week-3">Download Week 3 App</a>
</section>
</main>
<footer>
<p>&copy; 2023 We-Tri. All rights reserved.</p>
</footer>
</body>
</html>
11 changes: 5 additions & 6 deletions BackEnd/src/app.controller.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
import { Controller, Get, Res } from '@nestjs/common';
import { Response } from 'express';
import { join } from 'path';

@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}

@Get()
getHello(): string {
return this.appService.getHello();
indexHTML(@Res() response: Response): void {
response.sendFile(join(__dirname, '..', 'public', 'index.html'));
}
}
2 changes: 0 additions & 2 deletions BackEnd/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { typeOrmConfig } from './config/typeorm.config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { LoggerMiddleware } from './middlewares/logger.middleware';
Expand All @@ -16,7 +15,6 @@ import { ProfilesModule } from './profiles/profiles.module';
ProfilesModule,
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule implements NestModule {
configure(consumer: MiddlewareConsumer): void {
Expand Down
2 changes: 2 additions & 0 deletions BackEnd/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { winstonLogger } from './config/winston.config';
import { ValidationPipe } from '@nestjs/common';
import { ResponseTransformInterceptor } from './common/Interceptors/responseTransform. Interceptor';
import { HttpExceptionFilter } from './common/exceptionFilters/httpException.filter';
import * as express from 'express';

async function bootstrap() {
const app = await NestFactory.create(AppModule, {
Expand All @@ -13,6 +14,7 @@ async function bootstrap() {
app.useGlobalPipes(new ValidationPipe());
app.useGlobalFilters(new HttpExceptionFilter());
app.useGlobalInterceptors(new ResponseTransformInterceptor());
app.use('/static', express.static('public'));
SwaggerSetting(app);
await app.listen(3000);
}
Expand Down

0 comments on commit d05ff19

Please sign in to comment.