0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

SwaggerUIをIISサーバーに公開してみる

Posted at

1. はじめに

  • C#で開発しているOpneAPIのエンドポイントをWebサーバに公開したい
  • Visual Studioでデバッグでビルドした時に表示されるSwaggerUIは開発者のみしか参照できないので全員に公開したい

2. 開発環境

  • Windows Server
  • IIS

3. 事前準備

  • GitHubよりSwaggerUIを一式ダウンロードする。

image.png

4. IISサーバーへの配置

4.1. SwaggerUIのファイルをコピーする

  • ダウンロードしたSwaggerUiのdistフォルダ配下を下記へコピーする。

image 11.png

4.2. アプリケーションへの変換をする

  • 対象フォルダを右クリックしてアプリケーションの変換を選択する
    image 12.png

  • OKボタンをクリックする
    image 14.png

  • アプリケーションへの変換が完了する
    image 13.png

5. 動作確認

  • IISからSwagger UIが確認できるようになった。
    image 15.png

6. エンドポイントの修正

  • swagger-initializer.jsの下記URLを変更することで任意の設定に変更できる。
    image 16.png

7. 参考文献

0
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?