Skip to content

Simple Mantra app to define a REST Api the generate random values

License

Notifications You must be signed in to change notification settings

mantrajsframework/randomrestapi-mantrademo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random REST Api Mantra demo app

This simple app defines a Rest API method to generate a json object with a random value.

Only one component is defined (named as "randomapi").

To install the application run the following command inside the application folder:

$ mantrad install

Then, to start the appliction, run:

$ mantrad startapp

This application defines the route http://localhost:8080/randomapi/getrandom a GET Api to retrive the json with a random value with a timestamp. To check, use a tool like Postman or just open a web browser pointing to that route.

The result has this format:

{
    "success": true,
    "payload": {
        "randomvalue":"< 32 characters hex string with the random value >",
        "timestamp": <time stamp> 
    }
}

To see the routes created by the app, run:

$ mantrad show-gets

More about Mantra Framework

Read official documentation at Mantra site.

Download demos at Mantra site demos and learn by example.

Download common Mantra components at Mantra site components.

About

Simple Mantra app to define a REST Api the generate random values

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published