Skip to content
CF MEDIA

Hosting and server

Any web server works: a home computer, a NAS, regular hosting or your VPS. The files are static.

CORS

The browser version can only read your JSON files if the server allows access with the Access-Control-Allow-Origin header. The Android app reads them even without it.

nginx
location /cfmedia/ {
    add_header Access-Control-Allow-Origin *;
}
Apache (.htaccess)
<IfModule mod_headers.c>
  Header set Access-Control-Allow-Origin "*"
</IfModule>
Node.js
npx http-server --cors -p 8080

http or https

  • The default is http, which works on every device, including old TV boxes.
  • If your server only responds over https, the user turns on the lock (https) when typing the address, or types https://. Use {PREFIX} in URLs to follow that choice.
  • In a browser opened over https, the browser blocks http content. So the browser version should be opened over http when your server is http.

Cache

CF media always requests start.json and the pages fresh. For images and videos, use normal server caching. For pages that change a lot, Cache-Control: no-cache helps proxies along the way.

Recommended structure

folders
your-server/
  cfmedia/start.json   ← required (the app looks here)
  cfmedia/menu.json
  cfmedia/*.json       ← your pages
  media/               ← videos, music, photos
  img/                 ← icons, backgrounds, logo

Tips

  • Use {SERVER} in URLs: the same files work on your home IP and on the domain.
  • Test the address in the computer’s browser: http://your-address/cfmedia/start.json must show the JSON.
  • Invalid JSON (one extra comma) makes the app warn that “the content is not valid”. A JSON validator fixes it instantly.