Build in pure HTML, CSS and JavaScript (no heavy frameworks like React or Vue and with no build steps) a client that does the following:
Freeform text box where the user can input any question.
There should be a limit of 200 characters.
Form can be submitted using enter key.
A submit button should let the user submit the question by clicking on it.
The response, should be written under the form as it comes in.
The backend will stream it word by word.
While the answer is being returned, the form cannot be re-submitted.
The websocket connection is only established when the user submits a question, and is persisted for the duration of the answer being streamed back. Once the answer is finished, the connection is closed.
When the form is submitted, the connection with the WS is created. The prompt of the user is sent in the first WS request to the server as the body.
Any responses coming back from the server is considered to be a chunk of text.
If the socket closes with a 0 code, it successfully finished. If the code is different, an error happened.
Make the design visually appealing, close to what a chatbot would look like.
Build in pure HTML, CSS and JavaScript (no heavy frameworks like React or Vue and with no build steps) a client that does the following:
Related to #24