How it works…

Once we run the program, the HTTP server will start locally listening on port 8080.  

Browsing to http://localhost:8080 will show us the VueJS client page, which has an HTML form with Id, FirstName, and LastName fields, as shown in the following screenshot:

VueJS client page

Clicking on the Add button after filling in the form will send a POST request to the HTTP server running on port 8080, as shown in the following screenshot: 

Click on the Add button after filling in the form

Next, executing a GET request from the command line as follows, will give you a list of all the static employees:

$ curl -X GET http://localhost:8080/employees

 This will be alongside the newly added one as follows:

[{"id":"1","firstName":"Foo","lastName":"Bar"},{"id":"2","firstName":"Baz","lastName":"Qux"},{"id":"5","firstName":"Arpit","lastName":"Aggarwal"}]

 

 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.171.125