1. Install Docker Engine using this link.
  2. Create and run PostgreSQL as a Docker container using following command.
docker run -d -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=postgrespw postgres

3. Start the postgrescontainer.

sudo docker start postgres

4. View running Docker containers to get container-id of postgres container.

sudo docker ps -a

5. Copy <API-M_HOME>/dbscripts/apimgt/postgresql.sql file to postgres container.

sudo docker cp <API-M_HOME>/dbscripts/apimgt/postgressql.sql <container-id>:/var/lib/postgresql/

6. Login to postgres container.

sudo docker exec -i -t postgres bash

7. Login as postgres user.

su - postgres

8. Enter to psql terminal.

psql

9. Create a database named test.

create database test;

10. Create a…


  1. Install Docker Engine using this link.
  2. Create and run IBM DB2 as a Docker container using following command.
sudo docker run -itd --name db2 --privileged=true -p 50000:50000 -e LICENSE=accept -e DB2INST1_PASSWORD=db2inst1 ibmcom/db2

3. Start the db2 container.

sudo docker start db2

4. View running Docker containers to get container-id of db2 container.

sudo docker ps -a

5. Copy <API-M_HOME>/dbscripts/apimgt/db2.sql file to db2 container.

sudo docker cp <API-M_HOME>/dbscripts/apimgt/db2.sql <container-id>:/database/config/db2inst1/

6. Login to db2 container.

sudo docker exec -i -t db2 /bin/bash

7. Login as db2inst1 user.

su - db2inst1

8. Create a database named test.

db2 create database test

9. Connect…


  1. Run npm init command to initialize a new Node.js project
  2. Run npm install --save expressto install Express.js
  3. Create a file named mockapi.js and open it
  4. Enter the following code and save it
const express = require('express');
const app = express();
const port = 3000;
app.get('/*', (req, res) => {
res.json({message: 'Hello World, from express'});
});
app.put('/*', (req, res) => {
res.json({message: 'Hello World, from express'});
});
app.post('/*', (req, res) => {
res.json({message: 'Hello World, from express'});
});
app.delete('/*', (req, res) => {
res.json({message: 'Hello World, from express'});
});
app.patch('/*', (req, res) => {
res.json({message: 'Hello World, from express'});
});
app.listen(port, () => console.log(`Hello world, app is listening on port ${port}!`))

5. Run node mockapi.js command to start the mock API

6. Run curl -X GET localhost:3000 to invoke the API


When we enter the programming world, we start our journey with small programming experiments such as printing sequence of numbers and texts. Later we’re given to print several designs such as rectangles, triangles, and pyramids. But, how many of us tried to print a 5-pointed star?

At first, it seems very simple but when we look deeper it becomes more and more complicated. You cannot even find any published popular article for an algorithm to print symmetric 5-pointed star i.e. pentagram. In this article, you’ll find the python implementation of the pentagram.

Note: You need a basic mathematical understanding about…


Since WSO2 API Manager v3.1+ supports AWS Lambda functions, it provides a way to trigger AWS Lambda functions using a Class Mediator.

For more information on invoking AWS Lambda using WSO2 API Manager please read this article.

Not only you can trigger AWS Lambda functions directly, but also you can trigger them in the message mediation process. You only need to add a custom mediation in Runtime Configurations while API creation time. Only 2 steps to go!

Step 1 — Create a new custom mediation XML file

Create a new XML file including following lines.

<sequence xmlns="http://ws.apache.org/ns/synapse" name="lambda">
<class name="org.wso2.carbon.apimgt.gateway.mediators.AWSLambdaMediator"> …


AWS Lambda lets you run code without provisioning or managing servers. Amazon exposes AWS Lambda functions through various services like Amazon S3 and Amazon DynamoDB, process streaming data stored in Kinesis and AWS SDK. Although AWS Lambda runs your code in response to HTTP requests using Amazon API Gateway, to integrate Lambda functions to APIs through an API Manager properly you need to use AWS SDK.

WSO2 API Manager v3.1+ has integrated AWS Lambda using AWS SDK to invoke AWS Lambda functions to address above issue.

If API Manager is running on Amazon EC2, you can easily manage other Amazon…


Bored with learning new languages? Want to program your web app in your familiar language? Here’s the solution! You’ll be amazed by the features it has. Have you heard about AWS Lambda? Yes, this article is going to explain how to use AWS Lambda service.

AWS Lambda is a compute service provided by AWS, the cloud computing department of Amazon. Lambda is a function which you can use for implementing any type of application or back-end service. You only have to supply your code in one of the languages that AWS Lambda supports. It only executes your code when needed…

Binod Karunanayake

Software Engineer @WSO2 | Undergraduate @Department of Computer Science and Engineering of University of Moratuwa

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store