{"id":18160720,"url":"https://github.com/blankeos/express-vike-websockets","last_synced_at":"2025-04-07T03:54:41.534Z","repository":{"id":246599182,"uuid":"820612814","full_name":"Blankeos/express-vike-websockets","owner":"Blankeos","description":"Repro to demonstrate that Vite + Express Custom Server supports websockets.","archived":false,"fork":false,"pushed_at":"2024-06-28T23:29:45.000Z","size":317,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T08:41:20.479Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Blankeos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-26T20:32:01.000Z","updated_at":"2024-06-28T23:29:49.000Z","dependencies_parsed_at":"2024-06-29T00:33:19.699Z","dependency_job_id":"990e92a9-41b4-483b-a729-bc89ef7f699e","html_url":"https://github.com/Blankeos/express-vike-websockets","commit_stats":null,"previous_names":["blankeos/express-vike-websockets"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Fexpress-vike-websockets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Fexpress-vike-websockets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Fexpress-vike-websockets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Fexpress-vike-websockets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blankeos","download_url":"https://codeload.github.com/Blankeos/express-vike-websockets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247589831,"owners_count":20963022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-02T08:09:09.194Z","updated_at":"2025-04-07T03:54:41.500Z","avatar_url":"https://github.com/Blankeos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express, Vike, and Websockets\n\n### Checklist to know it works:\n- [x] The HMR works when you edit `+Page.tsx`\n- [x] The WebSocket handler works when you make a request to it.\n\n![alt text](image.png)\n\nTo test the websocket. Just go to the browser console with the app opened and paste this:\n\n```ts\nconst socket = new WebSocket('ws://localhost:3000/ws');\n\n// Event handler for when the connection is established\nsocket.onopen = function(event) {\n    console.log(\"OPEN\");\n    socket.send('WebSocket is open now.');\n};\n\n// Event handler for when a message is received from the server\nsocket.onmessage = function(event) {\n    console.log('Message from server:', event.data);\n};\n\n// Event handler for when the connection is closed\nsocket.onclose = function(event) {\n    console.log('WebSocket is closed now.');\n};\n\n// Event handler for when an error occurs\nsocket.onerror = function(error) {\n    console.log('WebSocket error:', error);\n};\n```\n\nThis app as scaffolded using [Bati](https://batijs.dev/)\n```ts\npnpm create @batijs/app --react --express\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblankeos%2Fexpress-vike-websockets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblankeos%2Fexpress-vike-websockets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblankeos%2Fexpress-vike-websockets/lists"}