Skip to content

Commit

Permalink
web socket test
Browse files Browse the repository at this point in the history
  • Loading branch information
tako0614 committed Mar 7, 2024
1 parent 0fca455 commit 1143b84
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"preact/": "https://esm.sh/[email protected]/",
"tailwindcss": "npm:[email protected]",
"tailwindcss/": "npm:/[email protected]/",
"tailwindcss/plugin": "npm:/[email protected]/plugin.js"
"tailwindcss/plugin": "npm:/[email protected]/plugin.js",
"ws": "npm:[email protected]"
},
"alias": {
"react": "preact/compat",
Expand Down
2 changes: 2 additions & 0 deletions fresh.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as $_404 from "./routes/_404.tsx";
import * as $_app from "./routes/_app.tsx";
import * as $about from "./routes/about.tsx";
import * as $api_logins_register from "./routes/api/logins/register.js";
import * as $api_logins_talk from "./routes/api/logins/talk.js";
import * as $api_oumu from "./routes/api/oumu.ts";
import * as $api_tako from "./routes/api/tako.ts";
import * as $api_token from "./routes/api/token.js";
Expand Down Expand Up @@ -37,6 +38,7 @@ const manifest = {
"./routes/_app.tsx": $_app,
"./routes/about.tsx": $about,
"./routes/api/logins/register.js": $api_logins_register,
"./routes/api/logins/talk.js": $api_logins_talk,
"./routes/api/oumu.ts": $api_oumu,
"./routes/api/tako.ts": $api_tako,
"./routes/api/token.js": $api_token,
Expand Down
7 changes: 7 additions & 0 deletions routes/api/logins/talk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const tali = () => {
const { response, socket } = Deno.upgradeWebSocket(c.req);

// websocketのハンドリング
socket.addEventListener("message", (e) => console.log(e));
return response;
}

0 comments on commit 1143b84

Please sign in to comment.