AngularJS Mock Services rest-tool

Here is the information about the rest-tool project, originally introduced by Gyorgy.

NPM source
https://www.npmjs.org/package/rest-tool

Project documentation
http://tombenke.github.io/rest-tool/

Quick Start Guide
http://tombenke.github.io/rest-tool/docs/getStarted.html

Install NPM modules
http://tombenke.github.io/rest-tool/docs/getStarted.html#installation

Create a simple project
http://tombenke.github.io/rest-tool/docs/getStarted.html#create-your-first-rest-api-project

Using canned mockup with booking flow

Refer: https://www.npmjs.org/package/canned

  • $ npm install canned
  • Unzip canned responses in bookingflow folder canned.zip
  • Update configuration.js file
    cmsUrl: 'http://localhost:3000/hal-cms',
    dsUrl: 'http://localhost:3000/hal-ds',
  • Launch canned server from root of bookingflow, default port is 3000, left here for documentation
    ./node_modules/canned/bin/canned -p 3000 ./canned

Limitation, rest calls that return images do not work properly.

Example on how to define a call

  • You will need to determine if it is a get or a post to generate the proper index file of either index.post.json or index.get.json, see the last statement of example
  • Use chrome to get the URL of the rest call, and then also to get the curl version of the rest call
  • You can string all of these together and create a bash script to do everything at once

mkdir -p /home/mruckman/Documents/bookingflow/canned/hal-ds/rest/pricing/v1.0.0/companyCode/HAL/cpp/countryCode/US

cd /home/mruckman/Documents/bookingflow/canned/hal-ds/rest/pricing/v1.0.0/companyCode/HAL/cpp/countryCode/US

curl 'https://qabook.hollandamerica.com/hal-ds/rest/pricing/v1.0.0/...