Installing and Using Apigility on IBM i

Install Apigility

I find the easiest way to accomplish this on the IBM i is to use PHP itself on command line:

$ php -r "readfile('https://apigility.org/install');" | php

After this is ran, Apigility will try to serve itself up. While it is successful in doing so, I have not been able to visit Apigility without errors when it is running this way on the IBM i. Therefore, I set it up normally through Apache:

Poor Man’s REST

Instead of relying Entity and Collection definitions, which would be the proper way, I have used a barebones approach to creating RESTful services when on the IBM i. This is largely due to the data I deal with daily, which is non-normalized and has column names that sometimes use special characters. Let’s take a look at the Resource and ResourceFactory for this service in case others need to take this same approach.

While it isn’t ideal to be running raw sql in the Resource, sometimes we don’t have much choice, and I wanted to demonstrate a simple way to get started on the IBM i. That’s it for now. Stay tuned for Apigility + OAuth2 on the IBM i and how to digest these services with Angular2.

Share this:

Related

Josh is a software developer who’s passionate about Open Source Software. He was recently named an IBM Fresh Face by IBM Systems Magazine for his work with Open Source on IBM i. His passion to spread Open Source awareness has driven him to speak at conferences such as the RPG & DB2 Summit, IBM COMMON, IBM PowerUP, and others. As a consultant, Josh gives his customers expert advice and training while also providing any software development they may need.