Skip to content

空きポートでWebUIを起動する#126

Merged
ayutaz merged 1 commit intoMidraLab:developfrom
shiena:feat/use-unused-port
Feb 5, 2025
Merged

空きポートでWebUIを起動する#126
ayutaz merged 1 commit intoMidraLab:developfrom
shiena:feat/use-unused-port

Conversation

@shiena
Copy link
Contributor

@shiena shiena commented Feb 4, 2025

現状はWebUIのポート番号が8080で固定なので使用されている場合はサーバーを起動できないので空きポートを使用するように改良しました。

TcpListenerでポート番号0を指定すると未使用ポートがリッスンされるのでそのポートを使っています。
そしてポート番号が動的なのでindex.htmlをテンプレート化してサーバー起動時に生成しています。
最後に生成したindex.htmlを削除します。
また、動的に生成されたindex.htmlをプロジェクトに含めないようにするため.gitignoreで無視しています。

@ayutaz
Copy link
Contributor

ayutaz commented Feb 4, 2025

@shiena ありがとうございます!

@ayutaz ayutaz merged commit 31e26c6 into MidraLab:develop Feb 5, 2025
1 check passed
@shiena shiena deleted the feat/use-unused-port branch February 5, 2025 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants