1.2.0 • Published 5 years ago

tetrapak-immersive-room-controller-service v1.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

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

WhatMethodURLResponse
All JourneysGETGET http://{address}:{port}/api/content/journeyJSON
A Single JourneyGETGET http://{address}:{port}/api/content/journey/:idJSON
All PollsGETGET http://{address}:{port}/api/content/pollJSON
A Single PollGETGET http://{address}:{port}/api/content/poll/:idJSON
All VideosGETGET http://{address}:{port}/api/content/videoJSON
A Single VideoGETGET http://{address}:{port}/api/content/video/:idJSON

General Endpoints

WhatMethodURLResponse
Server ConfigGETGET http://{address}:{port}/api/configJSON

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
},
keyDetails
portThe port number that the available endpoints are accessed from

mockdata

"mockdata": {
  "enabled": true,
  "port": 9090,
  "baseURL": "http://localhost:9090"
}
keyDetails
enabledDenotes whether the content api should return mocked data otherwise the data will come from the xpc endpoint
portThe port number that the mock data service api will run from

xpc

"xpc": {
  "baseURL": "http://1.2.3.4"
}
keyDetails
baseURLThe 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.