Table of contents
Routes table showing full absolute visitor URLs
Absolute route URLs

Appifio Creator · Lesson EM06 · Easy · 3 route methods

URL paths
add · remove · get - full structure

Only index.html runs by default. Easy: routes = client reads/writes routes.json (not a separate server action like Aura).

Golden rule: Content with its own URL → always addRoute + an HTML handler file. Delete content → removeRoute.
appifio_addRoute(routeKey, filePath, type?)

Job: Map the URL segment after the app link name → a page file.

Params:

  • routeKey - e.g. article-about-ai or nested tag/javascript
  • filePath - e.g. blog/detail.html
  • type - optional, e.g. 'blog', 'tag' (default null)
const r = await appifio_client.appifio_addRoute(
  'article-about-ai',
  'blog/detail.html',
  'blog'
);
await appifio_client.appifio_addRoute('tag/javascript', 'blog/tag.html', 'tag');

Returns: { success, message? }. Inside: read routes.json → edit → write back. Aura: route API + usually needs admin.

appifio_removeRoute(routeKey)
await appifio_client.appifio_removeRoute('article-about-ai');

Returns: { success }. Removes the line in routes.json. That URL 404s if nothing else maps it.

appifio_getRoutes()

Job: Read the full map (JS already parsed for you).

const r = await appifio_client.appifio_getRoutes();
if (r.success) {
  const routes = r.data.routes || {};
  const fallback = r.data.fallback; // usually "index.html"
}

Returns: { data: { routes: { [key]: { file, type?, enabled? } }, fallback? } } - no extra JSON.parse.

Absolute URLs (base tag)

Not a Storage method - a helper you attach on the page (avoids relative links breaking because of ):

function getAbsoluteUrl(path) {
  let siteUrl = window.location.origin;
  const apps = window.appifio?.global?.apps;
  if (apps?.site_url) siteUrl = apps.site_url.replace(/\/$/, '');
  let urlName = apps?.url_name
    || window.location.pathname.split('/').filter(Boolean)[0]
    || '';
  return siteUrl + '/' + urlName + '/' + String(path).replace(/^\//, '');
}
EM06 checklist (3/3): addRoute · removeRoute · getRoutes (+ absolute URL pattern)

Next

EM07 - Helpers (full methods)

Appifio Creator · User guide · EM06