-
Install API Connect, Ionic Framework & Apache Cordova
$ npm install apiconnect ionic cordova -g
-
Download the MFP8 Beta local version for your operating system (Windows, OS X, Linux)
-
Extract the .zip and install the MFP8 Developer Kit
-
Test the MFP8 CLI is installed correctly by opening a shell and typing
$ mfpdev -v
-
Test the MFP8 Server is installed correctly by opening a shell and changing directory to where you installed the server. Run the file
run.sh
(OS X, Linux) orrun.bat
(Windows) for example$ ./run.sh
. Keep the server running in this shell and open a new shell. -
Get a local copy of this repository
$ git clone https://github.com/danifitz/APIC-MFP-Employee-Demo.git
-
Change directory to the Demo
$ cd APIC-MFP-Employee-Demo
-
Build the
AuthAdapter
with Maven$ cd AdapterServices/AuthAdapter && mvn package
-
Deploy the
AuthAdapter
to the MFP server$ mfpdev adapter deploy
-
Repeat steps 9 & 10 for
EmployeeAdapter
-
Register the
IBMEmployeeApp
with the MFP server$ cd ../../IBMEmployeeApp && mfpdev app register
-
Preview the app
$ mfpdev app preview
> mbs: Mobile Browser Simulator
- Download the accompanying presentation
- Create a new instance of Cloudant NoSQL DB
- Create a new database in Cloudant called
employees
- Use
employees.json
file to populate documents in theemployees
database - Add your Cloudant service credentials to
EmployeeAPI/server/datasources.json
-
Create a new instance of the API Connect service on Bluemix
-
Launch the API Connect service. On the dashboard, create a new catalog called
EmployeeCatalog
-
Open a shell in the
EmployeeAPI
directory and run$ apic edit
-
In the API Connect toolkit, click Publish > Add and manage targets
-
Add a new Bluemix target. Choose your region and sign in. Choose the organisation and space you created the API Connect service in. Finally, choose the
EmployeeCatalog
catalog you just created. -
Type a name for your new application and click save.
-
Click Publish again and choose the target you just created.
-
Tick
Publish
and click the publish button -
In the shell where
apic
is running note down the values ofAPI Target URL
andTLS Profile
-
Back in the API Toolkit, click the 'APIs' tab then the 'Assemble' tab. In the left hand palette click the funnel icon and select 'Datapower Gateway Policies'
-
In the assembly canvas click the 'invoke' node. A menu will expand. In the
Invoke URL
field add theAPI Target URL
value you noted down earlier in the format below:
https://<API_TARGET_URL>$(request.path)
In the TLS Profile field add the value below:
client:Loopback-client
- Click 'Publish' again, this time select
Stage or Publish products
>Select specific products
>employeeapi
- Click publish - Open the API Connect dashboard on Bluemix. Click on the
EmployeeCatalog
. Click theSettings
tab. Click thePortal
tab. UnderPortal Configuration
selectIBM Developer Portal
. UnderUser Registration and Invitation
>User Registry
chooseSAML
- Once the portal has been setup you will receive an email, click the link in the email and create a portal
admin
account. - In the Portal, logout and click login, use your IBM ID. Click on the
Apps
tab. Register a new application, this will be the Employee app. Note down theClient ID
andClient Secret
- Click the
API Products
tab. ChooseEmployeeAPI
and scroll down to thePlans
section. ClickSubscribe
. Choose theApplication
you just created and click Subscribe.
You've now created an API Connect instance, deployed the API, configured it to be managed by Datapower, setup a Developer Portal, added a new subscriber Application and subscribed to an API plan.
-
In an editor, open
AdapterServices/EmployeeAdapter/EmployeeAdapterResource.java
-
Replace the variable
API_ENDPOINT
with your API Endpoint -
In the method
getHTTP()
replace the values in the twoX-IBM-Client-*
headers with theClient ID
andClient Secret
you noted down earlier -
Rebuild the adapters by running
$ mvn package
in theEmployeeAdapter
directory -
Deploy the adapter to the MobileFirst server (make sure the server is running first)
$ mfpdev adapter deploy