The Content API is a Spring Boot Java app with an embedded Tomcat. It primarily offers a REST interface at http://contentapi.example.com:8080/api/...
Installing and running
The Content API consists of a single JAR file. To start it, run the following command:
java -jar JARFILE
The configuration file application.yaml must be placed in the current working directory.
Using Docker
To run the Content API as a Docker container, use the following command:
docker run \
-p 8080:8080 \
--mount "type=bind,source=$(pwd)/application.yaml,target=/application.yaml" \
docker.subshell.com/sophora/contentapi
Configuration
The following is an example application.yaml file.
Please note that the configuration options for the connection to the Sophora Server are listed in the Spring Boot Sophora Commons documentation.
# Settings for Sophora server connection.
sophora:
client:
server-connection:
urls: https://sophora.example.com:1196
username: user
password: pass
content-api:
# Base URL of the Content API. This is used to generate URLs to the Content API in responses.
base-url: https://content-api.example.com
# Whether the Content API is used for a live or preview delivery. If true, time schedules and offline documents are regarded.
#
# Default: false
#
# is-live: false
# Configuration for copytext text links in responses.
text-links:
# URL prefix for text links in responses, used in the href attribute (may be empty.)
#
# Default: (empty)
#
# domain: https://www.example.com
# Whether to add a data-reference-url attribute in text links. This attribute contains a URL to the Content API.
#
# Default: false
#
# include-reference: false