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

パッケージ詳細v4.3.0

dhttpd

ディレクトリの簡単なローカルホスティング用の静的HTTPファイルサーバー。

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
3640
いいね数
141
Pub ポイント
140

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

flutter pub add dhttpd

パッケージ概要

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

dhttpd は Flutter 向けに構築された軽量で静的な HTTP ファイルサーバーであり、ディレクトリのコンテンツを簡単にローカルでホスティングできます。開発者は指定されたディレクトリから HTTP を介してファイルを配信でき、ウェブアセットのテストや静的サイトの提供、開発中のローカルなファイル共有に最適です。このサーバーは Android、iOS、macOS、Windows、Linux など複数のプラットフォームで動作し、クロスプラットフォームワークフローに適しています。最小限の設定で、複雑な構成なしにコンテンツをプレビューまたは共有できる簡単な方法を提供します。

用途

  • ローカル開発プレビュー
  • 静的Webアセットの提供
  • Webアプリケーションのテスト
  • デバイス間でファイルを共有する
  • クイックプロトタイピング

主な機能

  • 簡単なセットアップ
  • クロスプラットフォーム対応
  • 静的ファイルの提供
  • Lightweight
  • すべての主要プラットフォームで実行されます

適している対象

  • Flutter開発者
  • フロントエンドテスト担当者
  • ローカルWebサーバーが必要です
  • Prototyping
  • 開発環境

注意事項

  • 本番環境での使用は想定されていません
  • 静的ファイルに限定
  • 認証されていません
  • 高度な設定には手動設定が必要です
  • 動的コンテンツには適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Pub Package CI package publisher

A simple HTTP server that can serve up any directory, built with Dart. Inspired by python -m SimpleHTTPServer.

Install

Use the dart pub global command to install this into your system.

$ dart pub global activate dhttpd

Use

If you have modified your PATH, you can run this server from any local directory.

$ dhttpd

Otherwise you can use the dart pub global command.

$ dart pub global run dhttpd

Here's an example of creating a web app and then running it with this server:

$ dart create -t web web_app
$ cd web_app
$ dart pub get
$ dart run build_runner build -o build
$ dhttpd --path build/web/  # Serves app at http://localhost:8080
HTTPS

If you want to use HTTPS you will need to pass in the path of the SSL certificate and the SSL key file as well as the password string, if a password is set on the key, for example:

$ dart bin/dhttpd.dart --sslcert=example/server_chain.pem --sslkey=example/server_key.pem --sslkeypassword=dartdart
Server HTTPS started on port 8080

See the Dart documentation of SecurityContext.usePrivateKey for more details.

Configure

$ dhttpd --help
    --headers=<headers>                  HTTP headers to apply to each response. Can be used multiple times. Format: header=value;header2=value
    --host=<host>                        The hostname to listen on.
                                         (defaults to "localhost")
-l, --list-files                         List the files in the directory if no index.html is present.
    --path=<path>                        The path to serve. If not set, the current directory is used.
-p, --port=<port>                        The port to listen on. Provide `0` to use a random port.
                                         (defaults to "8080")
-q, --quiet                              Disable logging.
    --sslcert=<sslcert>                  The SSL certificate to use. Also requires sslkey
    --sslkey=<sslkey>                    The key of the SSL certificate to use. Also requires sslcert
    --sslkeypassword=<sslkeypassword>    The password for the key of the SSL certificate to use.
-h, --help                               Displays the help.
    --version                            Prints the version of dhttpd.

カテゴリー

依存関係

依存関係一覧 4 件

ソースリポジトリ

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