Read-only mirror of https://github.com/openTdataCH/ojp-meta-service — SBB. Issues & pull requests at the source.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2023-02-05 19:08:04 +01:00
.github/workflows try to fix dotenv issue in a simple way 2022-11-09 02:33:04 +01:00
docs Update documentation_sbb.md 2023-02-05 19:08:04 +01:00
src rename endpoint 2023-01-17 23:49:54 +01:00
.env.example implemented fernverkehrsserver. currently, get_all doesn't have it included. That's a workaround so the app doesn't try caching EP's from there. 2022-12-11 18:43:29 +01:00
.gitignore setup env vars 2022-11-09 12:38:52 +01:00
Cargo.lock update packages 2022-11-09 12:38:52 +01:00
Cargo.toml update packages 2022-11-09 12:38:52 +01:00
LICENSE Initial commit 2022-09-30 13:59:15 +02:00
README.md update readme 2023-01-20 17:12:50 +01:00

OJP Meta Service

Development

Make sure you have at least rust 1.64.0 (stable) installed.

Copy the dotenv template:

cp .env.example .env

replace actual tokens -> only the swiss system uses tokens so far.

to run the application: cargo run

to run tests: cargo test

Testing endpoints

If you want to test endpoints you can load docs/ojp_insomnia.json into your Insomnia and use those requests there.

If you want to test only our endpoints you can run the system with cargo run and then run requests agains http://localhost:8000.

Our most advanced endpoint is the trip_exchange POST endpoint. I takes request data in this form:

{
	"origin": {
		"name": "Bern",
		"reference": "8507000",
		"system": "ch"
	},
	"destination": {
		"name": "Wien Hauptbahnhof",
		"reference": "U3xBPTFATz1XaWVuIEhhdXB0YmFobmhvZkBYPTE2Mzc2NDEzQFk9NDgxODUxODRAVT04MUBMPTQ5MDEzNDkwMEBCPTFAcD0xNjY1MTMyOTEyQGk9QcOXYXQ6NDk6MTM0OUB8V2llbiBIYXVwdGJhaG5ob2Z8MTYuMzc2NDEzfDQ4LjE4NTE4NHx0cnVl",
		"system": "at"
	},
	"exchange": "ch:1:sloid:3000"
}

and should return a tuple in the form of (trips from origin to exchange point, trips from exchange point to destination)