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

패키지 상세v0.1.15

webdev_proxy

webdev의 serve 명령어용 간단한 HTTP 프록시입니다. 404를 루트 index로 재작성함으로써 HTML5 라우팅을 사용하는 앱을 지원합니다.

macOSWindowsLinux
30일 다운로드
5.4천
좋아요
5
Pub 점수
140

패키지 설치

flutter pub add webdev_proxy

패키지 개요

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

HTML5 라우팅을 사용하는 Flutter 애플리케이션을 위한 웹디브 서브 명령어용 가벼운 HTTP 프록시입니다. 404 오류를 가로채고 루트 index.html 파일을 제공하도록 다시 작성하여 서버 구성 없이도 원활한 클라이언트 측 라우팅을 가능하게 합니다. 히스토리 API 탐색에 의존하는 싱글 페이지 애플리케이션에 적합합니다. 프록시는 웹디브와 함께 실행되며 기존 코드나 빌드 프로세스에 변경 사항이 필요하지 않습니다.

사용 사례

  • Flutter 웹 앱에서 HTML5 라우팅 지원
  • 404 백업을 사용한 클라이언트 측 라우팅 처리
  • SPAs를 위한 개발 간소화
  • 웹 앱에서 깊은 링크 활성화
  • 서버 측 경로 구성 회피

주요 기능

  • 404를 index.html로 재작성합니다
  • webdev serve와 통합됩니다
  • 최소한의 설정 필요
  • 크로스 플랫폼 (macOS, Windows, Linux)
  • 코드 변경이 필요 없습니다

적합한 대상

  • HTML5 라우팅을 사용하는 Flutter 개발자
  • 웹上的 SPA 개발자
  • 로컬 개발 환경
  • 딥 링크가 필요한 앱
  • 복잡한 서버 설정을 피하는 팀

고려 사항

  • 생산 환경 사용을 위한 것이 아님
  • webdev가 실행 중이어야 합니다
  • 정적 자산 제공에 제한됨
  • 동적 경로를 처리하지 않습니다
  • 프록시는 수동으로 시작해야 합니다

원본 README

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

A simple HTTP proxy for webdev's serve command that adds support for rewriting certain requests, namely rewriting 404s to instead serve the root index (/).

Requirements

The latest release of webdev_proxy requires the following:

Installation

webdev_proxy is intended to be "activated" rather than installed as a package dependency.

$ dart pub global activate webdev_proxy

Learn more about activating and using packages here.

Usage

webdev_proxy supports one command: serve

webdev_proxy serve
Run `webdev serve` (a local web development server) behind a proxy that supports HTML5 routing by rewriting not-found requests to index.html.

Usage: webdev_proxy serve [-- [webdev serve arguments]]
-h, --help                 Print this usage information.
    --[no-]rewrite-404s    Rewrite every request that returns a 404 to /index.html
                           (defaults to on)

Run "webdev_proxy help" to see global options.

You may use any of the following options supported by `webdev serve` by passing them after the `--` separator.

webdev serve --help:
====================

Run a local web development server and a file system watcher that rebuilds on changes.

Usage: webdev serve [arguments] [<directory>[:<port>]]...
-h, --help                        Print this usage information.
-o, --output                      A directory to write the result of a build to. Or a mapping from a top-level directory in the package to the directory to write a filtered build output to. For example
                                  "web:deploy".
                                  A value of "NONE" indicates that no "--output" value should be passed to `build_runner`.
                                  (defaults to "NONE")

-r, --[no-]release                Build with release mode defaults for builders.
    --[no-]build-web-compilers    If a dependency on `build_web_compilers` is required to run.
                                  (defaults to on)

-v, --verbose                     Enables verbose logging.
    --auto                        Automatically performs an action after each build:

                                  restart: Reload modules and re-invoke main (loses current state)
                                  refresh: Performs a full page refresh.
                                  [restart, refresh]

    --chrome-debug-port           Specify which port the Chrome debugger is listening on. If used with launch-in-chrome Chrome will be started with the debugger listening on this port.
    --[no-]debug                  Enable the launching of DevTools (Alt + D). Must use with either --launch-in-chrome or --chrome-debug-port.
    --hostname                    Specify the hostname to serve on.
                                  (defaults to "localhost")

    --[no-]launch-in-chrome       Automatically launches your application in Chrome with the debug port open. Use chrome-debug-port to specify a specific port to attach to an already running chrome instance
                                  instead.

    --log-requests                Enables logging for each request to the server.

Run "webdev help" to see global options.

Note that you can configure the underlying webdev serve process by passing any of its supported command-line arguments after the -- separator.

Examples

To run the default server and proxy:

$ webdev_proxy serve

To pass arguments to webdev serve, e.g. to enable auto-refresh:

$ webdev_proxy serve -- --auto=refresh

카테고리

의존성

의존성 목록 10 개

소스 저장소

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

아직 데이터가 없습니다.