Gitlab repo explorer

Using Gitlab's public API, you have to build a file explorer for public repositories (similar to what they already have)

Gitlab file explorer

You will need to get the project id, and then you can access these API URLs to build the explorer:

  • For trees (directories): and then append ?path=path/inside/the/tree to list the contents of a subtree. You can also pass the ref query parameter to reference a certain branch.
  • For file contents: where:id is the id of the blob you want to display. Alternatively, you can also use the endpoint fetch more information about a certain file (:path is the full path to the file, url encoded). you can also pass the ref parameter to select a certain branch.