Skip to content

Make Asset Paths Relative #497

Closed
Closed
@srsgores

Description

@srsgores

Deploying code-server to a nested URL such as /code will result in assets being requested from /, when they should be /code.

The HTML source code references root-level assets:

<script type="text/javascript" src="main.js"></script>

We should, instead, allow users to specify if they are hosting on a nested URL like /code, thus appending the host to the HTML:

./code-server --host=0.0.0.0/code
<script type="text/javascript" src="/code/main.js"></script>

Reproduction Steps

  1. Deploy to a URL like /code, or /johhny/codes
  2. Start code server
  3. Visit the URL, and observe that assets are not requested from the desired URL (code), but instead, are requested from the root / URL

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions