Skip to content

Commit fa4efab

Browse files
authored
Merge pull request #9 from djmitche/add-patterns-to-readme
Add URL patterns to README.md
2 parents 8e9ce7a + 088b346 commit fa4efab

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ A simple library to generate URLs for various Taskcluster resources across our v
99
This serves as both a simple shim for projects that use JavaScript but also is the reference implementation for
1010
how we define these paths.
1111

12+
URLs are defined in the 'Taskcluster URL Format' document.
13+
1214
Changelog
1315
---------
1416
View the changelog on the [releases page](https://github.com/taskcluster/taskcluster-lib-urls/releases).

docs/urls-spec.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
11
---
2-
title: Specific paths for various Taskcluster resources
2+
title: Taskcluster URL Format
33
order: 10
44
---
55

6-
A Taskcluster `rootUrl` is a partial web address containing at least the scheme, host, and optionally a port. In addition, it can optionally specify a
7-
path which will end up being a prefix for all other resources.
6+
# RootUrl
87

9-
Examples:
8+
A Taskcluster `rootUrl` is a partial web address containing at least the scheme, host, and optionally a port. It cannot specify a path.
9+
10+
Example:
1011

1112
```
1213
https://taskcluster.example.com
13-
https://taskcluster.example.com/cluster1
14-
https://example.com/
15-
https://example.com/cluster2
1614
```
1715

18-
At a given `rootUrl`, the following resources will exist:
16+
# URLs
17+
18+
Taskcluster uses URLs with the following pattern:
19+
20+
| method | result |
21+
| --- | --- |
22+
| api(rootUrl, service, version, path) | `<rootUrl>/api/<service>/<version>/<path>` |
23+
| apiReference(rootUrl, service, version) | `<rootUrl>/references/<service>/<version>/api.json` |
24+
| docs(rootUrl, path) | `<rootUrl>/docs/<path>` |
25+
| exchangeReference(rootUrl, service, version) | `<rootUrl>/references/<service>/<version>/exchanges.json` |
26+
| schema(rootUrl, service, schema) | `<rootUrl>/schemas/<service>/<schema>` |
27+
| ui(rootUrl, path) | `<rootUrl>/<path>` |
28+
29+
*NOTE*: you should *always* use this library to generate URLs, rather than
30+
hard-coding any of the above patterns.
1931

20-
`$rootUrl/<path>`: At the root, the ui will be served.
21-
`$rootUrl/docs/<path>`: The taskcluster documentation site.
22-
`$rootUrl/references/<service>/<version>/api.json`: A reference for the api exposed by a service.
23-
`$rootUrl/references/<service>/<version>/exchanges.json`: A reference for exchanges published by a service.
24-
`$rootUrl/schemas/<service>/<version>/<schema>`: A schema associated with a service.
25-
`$rootUrl/api/<service>/<version>/<path>`: All services will be routed to under the prefix of `api` with the service name and version in the path as well.

0 commit comments

Comments
 (0)