Hello World REST API in mule
In this tutorial we will demonstrate how to create a simple Hello World REST API in mule and deploy the project on Mulesoft runtime environment
Create Project in Anypoint Studio as Mule Project – HelloWorld

Click Finish and Project is now created. Drag and drop HTTP component

Click on + button to define the endpoint configuration

Configure the Port to 8081 – here we will access the service on 8081 port

Define the path as

And the no error text will be shown on the top
Drag and Drop Set Payload activity

Update the Value as Hello #[message.inboundProperties.’http.query.params’.name]

Run the project


Application will start in Default domain

Open Chrome or any browser and hit –
http://localhost:8081/sayhello?name=World
you will see the response as below and here we are passing name as query parameter and as per the logic in mule service, Hello will be prepend to the parameter value

Your hard work is well appreciated. Please update the content to the latest version as few examples are still written in3.9 version instead of version 4. Thanks.