Skip to content
Astera Technology

Resolve assets beneath the application mount

Check mount-relative and root-relative references separately.

Download complete case notes and answer keys ↓

Set the decision and its input

The supplied mount is /staff/. Relative app.js resolves to /staff/app.js when that mount supplies its base; root base instead yields /app.js outside it. An explicitly root-relative /app.js remains outside even after the base is corrected.

Filled local test worksheet
CaseInput JSON
Base test{"mount":"/staff/","reference":"app.js"}
Download editable CSV ↓

Run the supplied comparison

Actual URL resolution uses synthetic .invalid labels without requesting them. A resolved address does not prove hosting availability.

Faulty and required outputs
PathOutput JSON
Faulty path{"pathname":"/app.js","insideMount":false}
Required path{"pathname":"/staff/app.js","insideMount":true}
Download editable CSV ↓
Complete local Node24.14.1 programme
import assert from 'node:assert/strict';

const run=function run(i,corrected=true){
    if(i.mount===null)return {held:true};
    const resolved=new URL(i.reference,'https://local.example.invalid'+(corrected?i.mount:'/'));
    return {pathname:resolved.pathname,insideMount:resolved.pathname.startsWith(i.mount)};
  };
const cases=[{"input":{"mount":"/staff/","reference":"app.js"},"corrected":false,"expected":{"pathname":"/app.js","insideMount":false}},{"input":{"mount":"/staff/","reference":"app.js"},"corrected":true,"expected":{"pathname":"/staff/app.js","insideMount":true}},{"input":{"mount":"/staff/","reference":"/app.js"},"corrected":true,"expected":{"pathname":"/app.js","insideMount":false}},{"input":{"mount":null,"reference":"app.js"},"corrected":true,"expected":{"held":true}}];
for(const test of cases){const actual=await run(test.input,test.corrected);assert.deepEqual(actual,test.expected);console.log(actual);}
Download runnable example ↓

Choose from the boundary evidence

The root-relative boundary prevents treating every reference as repaired by one base change. Missing mount remains held.

  1. Read the declared mount
  2. Resolve against its base
  3. Check the resulting path

Path resolution cannot certify a real hosting service.

Editable boundary inputs and outputs
ConditionInput JSONExpected output JSON
root-relative reference escapes subpath{"mount":"/staff/","reference":"/app.js"}{"pathname":"/app.js","insideMount":false}
mount not supplied{"mount":null,"reference":"app.js"}{"held":true}
Download editable CSV ↓

Which path belongs to the repaired base app.js?

Show the worked answer

/staff/app.js within the mount. /app.js remains a different destination outside the supplied subpath.

Related resources