cd cmd/tlserver && go install .
To start the server with the REST API endpoints, GraphQL API endpoint, GraphQL explorer UI, image generation endpoints, and without authentication (all requests run as admin):
tlserver server --playground --auth=admin --dburl=postgres://localhost/transitland_db?sslmode=disable
The above command assumes you have a Postgres database named "transitland_db" running on your machine under the default Postgres port. Alternatively set the database URL using the TL_DATABASE_URL
environment variable.
Open http://localhost:8080/
in your web browser or query it using an HTTP client.
To start stripped down, with only REST API endpoints (no GraphQL API or explorer UI, no static image API endpoints) and with JWT authentication:
tlserver server --disable-image --disable-graphql --auth=jwt --jwt-audience="http://example.com" --jwt-issuer="<issuer_id>" --jwt-public-key-file="<key.pem>"
Note that if you are using JWT authentication, place the process behind a reverse-proxy or gateway that can issue JWT tokens. At Interline, we use the combination of Kong and Auth0.
transitland-server
is released under a "dual license" model: