Closed nojronatron closed 4 months ago
See mock-wle-server repository.
Development will be tracked there with a lofty goal of integrating these two repositories in a larger project.
For the time being, see mock wle server project. It is a dev-and-test-focused project and provides:
Please describe. When developing and updating this code, it is sometimes necessary to hit the Submit button to complete the expected end-user processes. When doing this in an IDE, Netlify (etc) there is no API for the form to send the data to, and the POST call goes literally nowhere.
Describe the solution you'd like In this project, add an API server that can respond to REST calls Get and Post. When running, the server will serve-up a static webpage of the Form under test with its own FormServer and FormPort values added. When a Submit event happens on the Form, it sends a Post call back to the API server, and a log of the received data is recorded to a console/terminal so it can be analyzed to verify Form actual operation. Express.js is probably a simple option to consider.
Describe alternatives you've considered Copy the Form to the proper Winlink Express file system area and use Winlink Express to launch a new message using the Form, and observe the results of submission by examining the new message that results. This is what I currently do, and will continue to do before deciding code is ready for consideration to merge in.
Additional context Forms are coded with a Post action attribute set to
http://{FormServer}:{FormPort}
. When a Form is selected by a user in Winlink Express, that attribute is overwritten withhttp://localhost:8001
, presumedly this is done to allow avoiding port conflicts, or potentially sending the POST data to a different instance of Winlink Express. Also an assumption: These settings are configured via Winlink Express Settings Menu, Form Settings configuration window.A custom API service for development and testing would re-write the HTML form before delivering the static content, so that the Form Data that is Posted can be viewed, verifying the Form data is formatted correctly and contains the expected data.