패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.1.5

shelf_router_generator

소스 주석을 기반으로 shelf 웹 프레임워크용 요청 라우터를 생성하는 package:build 호환 빌더입니다.

AndroidiOSmacOSWindowsLinux
30일 다운로드
2.3만
좋아요
71
Pub 점수
140

패키지 설치

flutter pub add shelf_router_generator

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

ShelfRouterGenerator는 소스 주석에서 요청 라우터를 생성하는 Shelf 웹 프레임워크용 빌드 시 코드 생성기입니다. 개발자는 Dart 코드 내에서 간단하고 읽기 쉬운 주석을 사용하여 경로를 정의할 수 있으며, 이는 빌드 단계에서 처리되어 효율적인 라우팅 로직을 생성합니다. 이 접근 방식은 반복 코드를 줄이고 컴파일 시 라우팅 오류를 잡아내어 타입 안전성을 향상시킵니다. 이 패키지는 `package:build` 시스템과 원활하게 통합되며, Dart가 실행되는 모든 주요 플랫폼을 지원합니다.

사용 사례

  • 주석이 붙은 라우트 핸들러로 REST API 정의하기
  • 타입 안전한 라우트 매핑 생성
  • 셰lf 기반 서버에서 라우터 보일러플레이트 자동화
  • 경로 구성의 컴파일 시 검증 활성화
  • 웹 서비스에서 복잡한 라우팅 구조 간소화

주요 기능

  • 주석 기반 경로 정의
  • 빌드 시 코드 생성
  • 타입 안전한 라우팅
  • 패키지: build와의 통합
  • 플랫폼에 관계없이 서버 개발 지원

적합한 대상

  • 백엔드 서비스에 Shelf를 사용하는 개발자
  • 컴파일 시점 안전성을 우선시하는 팀
  • 최소한의 라우팅 보일러플레이트가 필요한 프로젝트
  • 다중 플랫폼을 대상으로 하는 Dart 개발자
  • 구조화된 라우팅을 갖춘 API 중심 애플리케이션

고려 사항

  • 코드 생성을 위해 build_runner가 필요합니다
  • 동적 라우팅과 비교하여 실행 시간 유연성이 제한됨
  • 빌드 시스템 워크플로우에 대한 이해가 필요합니다
  • 런타임 경로 구성에 적합하지 않습니다
  • 빌드 시간을 약간 증가시킬 수 있습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Build Status

About Shelf

Shelf makes it easy to create and compose web servers and parts of web servers. How?

  • Expose a small set of simple types.
  • Map server logic into a simple function: a single argument for the request, the response is the return value.
  • Trivially mix and match synchronous and asynchronous processing.
  • Flexibility to return a simple string or a byte stream with the same model.

It was inspired by Connect for NodeJS and Rack for Ruby.

See the package:shelf readme for more information.

Packages

Package Description Issues Version
shelf A model for web server middleware that encourages composition and easy reuse. issues pub package
shelf_packages_handler A shelf handler for serving a packages/ directory. issues pub package
shelf_proxy A shelf handler for proxying HTTP requests to another server. issues pub package
shelf_router A convenient request router for the shelf web-framework, with support for URL-parameters, nested routers and routers generated from source annotations. issues pub package
shelf_router_generator A package:build-compatible builder for generating request routers for the shelf web-framework based on source annotations. issues pub package
shelf_static Static file server support for the shelf package and ecosystem. issues pub package
shelf_test_handler A Shelf handler that makes it easy to test HTTP interactions. issues pub package
shelf_web_socket A shelf handler that wires up a listener for every connection. issues pub package
_shelf_compliance HTTP/1.1 compliance and hardening tests. issues (not published)

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

카테고리

의존성

의존성 목록 8 개

소스 저장소

이 패키지를 사용하는 프로젝트