1.2.0 • Published 5 years ago
tetrapak-immersive-room-controller-service v1.2.0
Intro
This is the main Room Controller Service for the Tetra Pak Immersive Room.
This service handles various functionality of the immersive room ecosystem e.g.
- XP Content Retrieval
- Inter-App Communication
- XPKit Integration
- State Management
XP Content Retrieval
The Room Controller Service provides an API for retrieving content from the XPC CMS. The API provides various end points for retrieving the content e.g. journeys, polls and videos.
The end points (internally) will either retrieve data from a "live" provider or from "mocked up" data.
API Endpoints
Content Endpoints
What | Method | URL | Response |
---|---|---|---|
All Journeys | GET | GET http://{address}:{port}/api/content/journey | JSON |
A Single Journey | GET | GET http://{address}:{port}/api/content/journey/:id | JSON |
All Polls | GET | GET http://{address}:{port}/api/content/poll | JSON |
A Single Poll | GET | GET http://{address}:{port}/api/content/poll/:id | JSON |
All Videos | GET | GET http://{address}:{port}/api/content/video | JSON |
A Single Video | GET | GET http://{address}:{port}/api/content/video/:id | JSON |
General Endpoints
What | Method | URL | Response |
---|---|---|---|
Server Config | GET | GET http://{address}:{port}/api/config | JSON |
Configuration
The service is controlled via the values set in the config.json
.
The following sections exist in the config file...
server
"server": {
"port": 9080
},
key | Details |
---|---|
port | The port number that the available endpoints are accessed from |
mockdata
"mockdata": {
"enabled": true,
"port": 9090,
"baseURL": "http://localhost:9090"
}
key | Details |
---|---|
enabled | Denotes whether the content api should return mocked data otherwise the data will come from the xpc endpoint |
port | The port number that the mock data service api will run from |
xpc
"xpc": {
"baseURL": "http://1.2.3.4"
}
key | Details |
---|---|
baseURL | The XPC Player API base endpoint. If the above mockdata.enabled if false, then the content will be retrieved from this baseURL endpoint. |
Deployment
The service runs within NodeJS and managed by PM2. See Technical Spec Server Setup for details.