CoderVib — Canonical Company Info

Files: company-info.json, company-info.xml, company-info.html. Public & cacheable. No secrets.

Purpose

Single source of truth for company contact, links, social, and small runtime config. Host these files under /cdn/company/info/ and all apps/sites read from it.

Recommended .htaccess (CORS + Cache)

# Put into /public_html/cdn/company/info/.htaccess

  Header set Access-Control-Allow-Origin "*"
  Header set Access-Control-Allow-Methods "GET, OPTIONS"
  Header set Access-Control-Allow-Headers "Content-Type"
  Header set Cache-Control "public, max-age=3600"

Adjust max-age to match meta.ttl_seconds in JSON.

Usage: JavaScript (browser)

const URL = 'https://cx.codervib.com/cdn/company/info/company-info.json';
fetch(URL, { cache: 'no-store' })
  .then(r => r.json())
  .then(cfg => {
    // example: inject phone into page
    const phone = cfg.contacts.phone_e164;
    document.getElementById('phone').textContent = phone;
    // example: link to free tools
    document.getElementById('free-tools').href = cfg.links.free_tools;
  })
  .catch(err => console.error('cfg load error', err));

Usage: Node / Server-side

// Node (fetch)
import fetch from 'node-fetch';
const cfg = await (await fetch('https://cx.codervib.com/cdn/company/info/company-info.json')).json();
console.log(cfg.company.name);

Usage: PHP

<?php
$json = file_get_contents('https://cx.codervib.com/cdn/company/info/company-info.json');
$cfg = json_decode($json, true);
echo $cfg['contacts']['phone_e164'];
?>

Usage: Python

import urllib.request, json
url = 'https://cx.codervib.com/cdn/company/info/company-info.json'
with urllib.request.urlopen(url) as r:
    cfg = json.load(r)
print(cfg['company']['name'])

XML Consumers

// Python example with xml.etree
import urllib.request, xml.etree.ElementTree as ET
xml = urllib.request.urlopen('https://cx.codervib.com/cdn/company/info/company-info.xml').read()
root = ET.fromstring(xml)
phone = root.findtext('.//contacts/phoneE164')
print(phone)

Extending safely

Place new fields under extras (JSON) or <extras> (XML). Keep old fields until all consumers migrate. When removing or renaming a field, bump meta.schema_version.

Notes & FAQ