-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- feat: WebSocket route for `Rotuer` is now supported - fix: Upgraded connection should not be read from `processRequest` - added: `markAsResponded()` and `markAsUpgraded()` to `Responder`
- Loading branch information
Showing
11 changed files
with
210 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Article } from "../components/article.tsx"; | ||
import { Code } from "../components/code.tsx"; | ||
import React from "../../vendor/https/dev.jspm.io/react/index.js"; | ||
import { DFC } from "../../jsx.ts"; | ||
import { fetchExample } from "../content.ts"; | ||
import { Content } from "../components/content.tsx"; | ||
import { Q } from "../components/common.tsx"; | ||
|
||
const HandleWebSocket: DFC<{ codes: { [key: string]: string } }> = ({ | ||
codes | ||
}) => ( | ||
<Content> | ||
<Article> | ||
<section id={"handle-ws"}> | ||
<h2>Handle WebSocket</h2> | ||
<p> | ||
Servest provides WebSocket handler for Router API. | ||
<Q>router.ws()</Q> is register for WebSocket route. <br /> | ||
Handler will be called after WebSocket upgrade finished. | ||
</p> | ||
<Code href={"/example/handle_ws.ts"} code={codes["handle_ws.ts"]} /> | ||
</section> | ||
</Article> | ||
</Content> | ||
); | ||
|
||
HandleWebSocket.getInitialProps = async () => { | ||
const codes = Object.fromEntries( | ||
await Promise.all( | ||
["handle_ws.ts"].map(async v => { | ||
return [v, await fetchExample(v)]; | ||
}) | ||
) | ||
); | ||
return { codes }; | ||
}; | ||
|
||
export default HandleWebSocket; |
Oops, something went wrong.