
The website used to host every past test suite, copied into the www directory. We no longer need that on the website (and it makes the codebase impossible to search) so I removed all the old tests and the new tests are hosted simply at /test. I also replaced the www.js script with a simpler www.sh one (since we no longer need to do anything besides copying, really), which allowed me to remove a node dependency that was only used in that script.
919 B
Htmx Realtime Test Server
This package implements a realtime server for testing WebSockets and Server Sent Events (SSE) in htmx.
What It Does
This server listens for incoming WebSocket connections coming in to ws://localhost:1323/echo. When it receives messages from any WebSocket client, it responds with that same content in a way that htmx can process. This means, that the response message will look like this: <div id="idMessage" hx-swap-oob="true">{your message here}</div>
How to Use This Server
-
If you do not already have Go (version 1.17 or higher) installed on your machine, you can download an installation for your machine from the Go website
-
Open up a terminal window and navigate to this directory. Start up the WebSocket server by typing
go run server.go
-
Open your web browser to http://localhost to run the manual tests. Huzzah!