You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c1fdd19
Browse filesBrowse the repository at this point in the historyBrowse files
- get the token (API key) for the new service - https://api-manager.opentransportdata.swiss/
22
-
23
-
- create a new secret in the repo https://github.com/openTdataCH/api-explorer/settings/secrets/actions
24
-
25
-
- add the key name as a placeholder the `.env` file and with real value in the `.env.local` file (this is ignored by Git)
26
-
```
27
-
# .env (commited, in the repo)
28
-
API_KEY_NEWAPI=PLACEHOLDER
29
-
30
-
# .env.local (file excluded from Git)
31
-
API_KEY_NEWAPI=eyJvcmciOiI2NDA....
32
-
```
15
+
# edit api-tokens.local.ts
16
+
# fill with tokens obtained from https://api-manager.opentransportdata.swiss/
33
17
34
-
- add the key to `Build index.html landing page / API folders` task in [.github/workflows/publish-swagger.yml](./.github/workflows/publish-swagger.yml)
18
+
# develop on localhost
19
+
$ ng serve
35
20
21
+
# open http://localhost:4200
36
22
```
37
-
- name: Build index.html landing page / API folders
38
-
env:
39
-
# from repo secrets https://github.com/openTdataCH/api-explorer/settings/secrets/actions
40
-
... more keys
41
-
42
-
API_KEY_NEWAPI: ${{ secrets.API_KEY_NEWAPI }}
43
-
run: |
44
-
node scripts/render-openapi.mjs
45
-
```
46
-
47
-
- add a new entry in [apis.yaml](./apis.yaml). the id used will be used in the permalink URL, i.e. for `ojp1.0` the URL + path is https://opentdatach.github.io/api-explorer/ojp1.0/
48
23
49
-
```
50
-
apis:
51
-
- id: new_service
52
-
title: New Service
53
-
map_secrets:
54
-
API_KEY: API_KEY_NEWAPI
55
-
...
56
-
```
57
-
58
-
- duplicate any of the folders in `openapi/` folder as `openapi/new_service`.
59
-
60
-
- edit the OpenAPI specs in `openapi/new_service/openapi.template.yaml` file
24
+
## Adds a new API
61
25
62
-
- run `npm build` and inspect the `dist` folder
26
+
- get the token (API key) for the new service - https://api-manager.opentransportdata.swiss/
- duplicate and edit one of the existing OpenAPI specs - [./public/openapi](./public/openapi)
63
32
64
33
## Deployment
65
34
66
-
A GitHub Actions workflow (under [.github/workflows/publish-swagger.yml](./.github/workflows/publish-swagger.yml)) builds the site and publishes it to GitHub Pages on push to the default branch
35
+
A GitHub Actions workflow (under [.github/workflows/deploy-pages.yml](./.github/workflows/deploy-pages.yml)) builds the site and publishes it to GitHub Pages on push to the default branch
67
36
68
37
## License
69
38
70
39
The project is released under a [MIT license](./LICENSE.txt).
71
40
72
-
Copyright (c) 2025 Open Data Platform Mobility Switzerland - [opentransportdata.swiss](https://opentransportdata.swiss/en/).
41
+
Copyright (c) 2025 - 2026 Open Data Platform Mobility Switzerland - [opentransportdata.swiss](https://opentransportdata.swiss/en/).
0 commit comments