The quickest way to "test out" a PJS module to see how things work is to create it as a Express Route (web service), and call it using a browser.

Example 1

In the following example, we'll create a web service to pass in a customer number = 1234, and get back the customer nameĀ  for that customer number.


Example 2

The previous example sends back the "response" as a text message. In the next example, we'll send back the reponse as JSON.


Example 3

In the next example, we'll create a web service that's supposed to be called as a POST request, with a "body" that contains input parameters as a JSON object , instead of a GET request with input parms specified as query string parameters.