パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.1.15

webdev_proxy

webdev の serve コマンド用のシンプルな HTTP プロキシ。404 をルートの index にリライトすることで、HTML5 ルーティングを使用するアプリをサポートします。

macOSWindowsLinux
30日間ダウンロード
5440
いいね数
5
Pub ポイント
140

パッケージをインストール

flutter pub add webdev_proxy

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

HTML5ルーティングを使用するFlutterアプリケーション向けに設計された、webdev serveコマンド用の軽量HTTPプロキシです。404エラーを検出し、それらをルートのindex.htmlファイルを提供するように書き換えることで、サーバー設定なしでスムーズなクライアントサイドルーティングを実現します。履歴APIナビゲーションに依存するシングルページアプリに最適です。プロキシはwebdevと併用され、既存のコードやビルドプロセスに変更を加える必要がありません。

用途

  • Flutter Webアプリでの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 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。