Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

...

Service-Oriented Architecture built using JavaScript (SOAJS). Its services can be combined to provide the functionality of a large software application. Each Service is a collection of APIs easily managed by SOAJS framework and productized with multitenant capability. Its embedded self-awareness makes it easier to scale both horizontally and vertically letting all services running on the cloud to communicate effortless and form a massive reliable and scalable infrastructure to empower the communication between the product frontend and backend. SOAJS comes with tons of features, implementing SOAJS framework means getting a boost start of at least 50%.

In this page we will introduce a simple hello world example that demonstrates how easy it is to build a micro-service on top of SOAJS. 

...

The Hello World service is available under the soajs.examples repository, you need to go over the readme under soajs.examples to setup the environment

Now we will show you how to start the service and interact with it.

Code Block
languagebash
titleStarting Hello World Service
linenumberstrue
# go to examples/hello_world and start the service
cd soajs.examples/hello_world/

# start the soajs example environment 
sudo soajs services start --env=example

# export necessary environment variables to create local awareness
export SOAJS_ENV=EXAMPLE
export SOAJS_SRVPORT=4020
export SOAJS_DEPLOY_MANUAL=1
export SOAJS_REGISTRY_API=127.0.0.1:21000


# start service
node .


Test the Service 

...

Once the service starts, run the following curl command that calls the API of your "hello world" service and check out the response returned.

Code Block
languagebashjs
titleCURL command calling hello world API
linenumberstrue
$ CURL -X GET "http://127.0.0.1:4020/hello?firstName=John&lastName=Doe"

...