Skip to content

AXUM 프레임워크 의존성 추가 및 헬스체크 API 추가#27

Merged
reddevilmidzy merged 2 commits intomainfrom
api
May 12, 2025
Merged

AXUM 프레임워크 의존성 추가 및 헬스체크 API 추가#27
reddevilmidzy merged 2 commits intomainfrom
api

Conversation

@reddevilmidzy
Copy link
Owner

♟️ What’s this PR about?

AXUM 프레임워크를 사용하여 헬스체크 api를 추가하였다.

🔗 Related Issues / PRs

close: #22


프레임워크 선정은 지피티 친구가 도와주었다.

✅ Rust 웹 프레임워크 비교

프레임워크 장점 단점 서버리스 지원
Actix Web 🚀 최고 성능 (비동기 처리 빠름) 🛠️ 풍부한 미들웨어 💪 안정적이고 오래됨 😵 복잡하고 러닝커브 있음 🧩 async 모델이 조금 다름 (Send + Sync 요구) ✅ 지원
Rocket ✨ 문법이 직관적이고 사용 쉽다 🛡️ 타입 안전성 최고 🔒 보안 기능 내장 (CORS, CSRF 등) ⛔️ nightly Rust 요구 (안정화되고 있지만) 🚫 서버리스 지원 미흡 📦 무겁고 느린 편 ❌ 미흡
Warp 🌀 고성능 + 함수형 스타일 ⚡ 필터 체인 방식 (조합성 높음) 🪶 가볍고 서버리스 친화적 🤯 러닝커브 급격 (필터 체인 익숙해져야 함) 😢 진입장벽 있음 ✅ 지원
Axum 🌱 현대적이고 쉬움 (Tower 기반) 🔥 Tokio와 자연스럽게 연동 📦 확장성 좋고 서버리스에 최적 🚧 비교적 신생 (2021 이후 발전) 🔋 기능은 Warp보다 적음 (하지만 충분함) ✅ 최적화됨
Poem 📚 Axum보다 기능 완비형 (OpenAPI, 인증 등 내장) 🚀 서버리스, 배치 모두 지원 🧩 axum과 사용법 비슷 📦 덜 알려져 있고 생태계 작은 편 🔧 일부 부분은 overkill 일 수 있음 ✅ 지원

Queensac 요구사항 분석

  • 🎯 기능:
    매일 링크 체크 스케줄링 (배치성)

  • ☁️ 배포:
    서버리스를 염두 (AWS Lambda, Cloud Run 등)

  • 🪶 복잡도:
    간단함 유지하고 싶고, 서버리스에 최적화된 구조 원함

결론은 ✅ Axum

서버리스 (Lambda) 배포에 바로 맞고, 스케줄링 + API 처리를 같은 코드베이스로 쉽게 처리 가능.
Rust의 현대적 async 스타일 (Tokio 기반)이랑 자연스럽게 맞음. 필요시 OpenAPI, 인증도 확장 가능 (Poem처럼 무겁지 않게)

Copilot AI review requested due to automatic review settings May 12, 2025 05:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request integrates the AXUM framework to add a basic health check API to the project while also setting up the repository link checking functionality.

  • Added a health check endpoint ("/check") using AXUM.
  • Introduced a TCP listener for AXUM server in main.rs.
  • Updated Cargo.toml to include the AXUM dependency.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/main.rs Added a health check API endpoint and AXUM server setup; potential issue with repository link checking.
Cargo.toml Added the AXUM dependency to support the new API.

Comment on lines +23 to +24
let _repo_check = check_repository_links(repo_url, interval_duration);

Copy link

Copilot AI May 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repository link check future is created but not awaited or spawned, which means it won't execute concurrently. Consider using tokio::spawn to run check_repository_links concurrently with the AXUM server.

Suggested change
let _repo_check = check_repository_links(repo_url, interval_duration);
tokio::spawn(async move {
check_repository_links(repo_url, interval_duration).await;
});

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

일단 여기 pr에서는 프레임워크 추가하고 간단한 health check api만 추가한거라 check_repository_links 는 다음 pr에서 작업할게욥. 아직 API를 뭘로 할지도 못정했어연

Comment on lines +9 to +12
async fn health_check() -> &'static str {
"OK"
}

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

얌마 뭘보고 이 코드가 잘 동작한다고 판단할 수 있겠니 테스트 추가 ㄱㄱ

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

테스트 짜려다가 구조를 변경하고 있다 ㅋㅋㅋ
역시 테스트 짜기 어려운 구조는 클린하지 못한 코드라는걸 다시한번 깨닫는,,,

테스트는 다음 PR에서 구조를 변경하면서 추가하도록 하자.
살짝 스포하면 lib.rs를 사용하여 main.rs의 책임을 분리시키고 서버 실행하는 함수를 따로 만들 것이다. (ex. run())

@reddevilmidzy reddevilmidzy merged commit d44fc5f into main May 12, 2025
2 checks passed
@reddevilmidzy reddevilmidzy deleted the api branch May 12, 2025 05:56
@reddevilmidzy reddevilmidzy added this to the 1차 MVP 구현 milestone Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

프레임워크 선택

2 participants