This demo shows how to launch a dynamic site containing the following parts:
/index.html
- the main page referencing a CSS and a java script files. Note that the javascript is
imported using the standard ESM import
notation/index.css
- styles for the HTML page./index.js
- the main application code. This script listens the input box and sent its content to
the server-side API./api/:name
- dynamic server-side endpoint running responding to GET HTTP requests from the client.
This endpoint returns JSON object with a greeting message using the transmitted name with the current time.
The name of the user is loaded from the URL.
Example of the server response:
{ "name" : "John", "time" : "11:02:59", "milliseconds" : "785" }