webdev_proxy
webdev의 serve 명령어용 간단한 HTTP 프록시입니다. 404를 루트 index로 재작성함으로써 HTML5 라우팅을 사용하는 앱을 지원합니다.
Dart 팀이 개발한 도구인 webdev serve 명령어용 간단한 HTTP 프록시로, 특정 요청을 재작성하는 기능을 추가합니다. 특히 404 오류를 대신하여 루트 인덱스(/index.html)를 제공하도록 재작성합니다. 이를 통해 HTML5 라우팅을 사용하는 브라우저 애플리케이션(예: 우리 자신의 것들)을 개발하면서도 페이지를 새로 고치거나 직접 깊은 링크로 이동할 수 있습니다.
^2.3.1>=0.13.3 <2.0.0^3.2.1^1.0.3^1.1.0^1.16.0^2.1.2^1.2.0^1.0.0^1.10.0^2.1.2>3.0.0 <5.0.0>=2.0.1 <5.0.0^1.1.0^4.1.0^1.17.12^3.0.0아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
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 (/).
The latest release of webdev_proxy requires the following:
2.11 or laterwebdev globally activated at a version in the >=1.0.1 <3.0.0 range
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.
webdev_proxy supports one command: serve
webdev_proxy serveRun `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.
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