ThreePresenter API Documentation - v0.1.2
    Preparing search index...

    Class StaticBaseUrlResolver

    Static base URL resolver

    Prepends a base URL to relative paths. Useful for CDN or static file hosting.

    const resolver = new StaticBaseUrlResolver('https://cdn.example.com/models');
    const url = resolver.resolve('scene.glb', {});
    // => 'https://cdn.example.com/models/scene.glb'

    Implements

    Index

    Constructors

    Methods

    Properties

    Constructors

    Methods

    • Resolve a file path to a full URL

      Parameters

      • filePath: string

        The file path to resolve (can be relative or absolute)

      • _context: FileResolverContext

      Returns string

      The full URL to load the file from

      // Relative path
      const url = resolver.resolve('model.glb', { projectId: '123' });
      // => 'http://localhost:3000/api/projects/123/files/model.glb'

      // Absolute path (pass through)
      const url = resolver.resolve('http://example.com/model.glb', {});
      // => 'http://example.com/model.glb'

    Properties

    baseUrl: string