# README

Gateway using Custom-Pattern

This recipe is a gateway using the custom pattern. It uses counter activity to keep the track of number of successful and failed HTTP calls.

Example:

Counter Activity

NameTypeDescription
counterNamestring, required:trueThe name of the counter
opstringCounter operation, 'get' is the default operation

Installation

  • Install Go

Setup

git clone https://github.com/project-flogo/microgateway
cd microgateway/examples/api/custom-pattern

Testing

Start the gateway:

go run main.go

In another terminal start the server:

go run main.go -server

Request is successful

Run the following command:

curl --request GET http://localhost:9096/endpoint

You should see on successful call:

{"Error-Calls":0,"Success-Calls":1}

Similarly, on unsuccessful call...or in case of error: You should see on successful call:

{"Error-Calls":1,"Success-Calls":0}