Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename and split Application.swift #443

Merged
merged 1 commit into from
May 18, 2024

Conversation

omochi
Copy link
Contributor

@omochi omochi commented May 18, 2024

背景

古来、 Application.swift には extension Application が書かれていました。
これは Vapor.Application の事でした。

以下のパッチにより、vapor の利用は廃止され、
このファイルには Server.HTTPHandler などが書かれるようになりました。

2e62088#diff-f90940556aae24c2f20d9e1096fa58c020fda927ef748b3271a50e02e0ad1379

課題

ファイル名と中身が大きく異なっているため、
コードを読む時の見通しが悪いと感じました。

変更

Application.swift を以下の3つのファイルに分割します。

ServerHTTPHandler.swift

元ソースの Server.HTTPHandler のコードを移します。

ServerWebSocketHandler.swift

元ソースの Server.WebSocketHandler のコードを移します。

ContentTypes.swift

元ソースの func contentType(of:) のコードを移します。

@omochi omochi force-pushed the split-application.swift branch from 3e4329a to ba1c4f1 Compare May 18, 2024 04:43
@kateinoigakukun kateinoigakukun merged commit 46adbb0 into swiftwasm:main May 18, 2024
1 of 3 checks passed
@kateinoigakukun kateinoigakukun changed the title Application.swift をリネームし、分割する Rename and split Application.swift May 19, 2024
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