Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
content/local
db
src/main
README.md
knotx-standalone.json
knotx-standalone.logback.xml
pom.xml
run.sh

README.md

Adapt service without Web API

In this tutorial we create a page: http://localhost:8092/content/local/books.html displaying books and authors that are available in a relational database.

Database access is not available via WebAPI thus we have 2 options:

  1. Implement a Web API layer to access the database and then integrate with it using e.g. AJAX or an HTTP adapter.
  2. Implement a Knot.x Service Adapter.

For the demonstration purposes we're going to use HSQL database in this example.

Follow this tutorial in order to set up the database. To create tables with data use the script provided in db folder of this tutorial.

To run this tutorial you will need Java 8 and Maven installed.

  1. Download knotx-standalone-1.2.0.fat.jar to app folder in this tutorial root.
  2. Build custom service adapter using mvn clean install command.
  3. Copy custom-service-adapter-1.2.0-fat.jar (from target folder after successful maven build) to app folder.
  4. Use run.sh to start Knot.x instance with custom adapter.