# go to correct directoryexamples/hello_world and start the service
cd /opt/soajs.examples/nodehello_modules/soajs.examples/example01/world/
# start the soajs example environment
sudo soajs services start --env=example
# export necessary environment variables to create localawareness
export SOAJS_PROFILE=/opt/soajs/node_modules/soajs.utilities/data/getStarted/profile.jsENV=EXAMPLE
export SOAJS_SRVPORT=4021
export SOAJS_ENVDEPLOY_MANUAL=test1
export SOAJS_REGISTRY_SRVIPAPI=127.0.0.1:21000
# start service
node .
Each running service listens on two ports: The data port and the maintenance port.
The service in this example runs on the local machine, and listens on port 40104021.
The second port is the maintenance port. The convention we use at SOAJS for maintenance ports is maintenance port = data port + 1000 therefore, the maintenance port is 5010 for this service.
...
Code Block
language
bash
title
Heartbeat
linenumbers
true
curl -X GET "http://127.0.0.1:50105021/heartbeat"
The response below indicates that the service is running without any errors.
...
Code Block
language
bash
title
TestGet request: Missing Last Name
curl -X GET "http://127.0.0.1:40104021/testGet?firstName=John"
As expected, the API returned an error response. Since "lastName" is a required field and is missing in the querystring, the IMFV stopped the request returned an error response.
...
Code Block
language
bash
title
TestGet request: Success
linenumbers
true
curl -X GET "http://127.0.0.1:40104021/testGet?firstName=John&lastName=Smith"