https://github.com/passy/tube-roundel
Web service for rendering TfL Tube roundels.
https://github.com/passy/tube-roundel
Last synced: about 1 year ago
JSON representation
Web service for rendering TfL Tube roundels.
- Host: GitHub
- URL: https://github.com/passy/tube-roundel
- Owner: passy
- License: bsd-3-clause
- Created: 2016-09-03T13:30:16.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-05-22T15:59:57.000Z (about 6 years ago)
- Last Synced: 2025-04-30T05:45:20.418Z (about 1 year ago)
- Language: Haskell
- Homepage:
- Size: 23.4 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.markdown
- License: LICENSE
Awesome Lists containing this project
README
# tube-roundel
[](https://travis-ci.org/passy/tube-roundel)
[](https://hub.docker.com/r/passy/tube-roundel/)
[](https://microbadger.com/#/images/passy/tube-roundel)
> A simple Haskell web-service for rendering TfL Tube Roundels in different
> colors as either PNG or SVG.

## Endpoints
Currently, only one endpoint is supported which lets you generate a single
roundel without any text in color you specify as hex color code.
- `/roundel/no-text/:color/image.svg` as `image/svg+xml`
- e.g. `/roundel/no-text/F8B195/image.svg`
- `/roundel/no-text/:color/image.png` as `image/png`
- e.g. `/roundel/no-text/F8B195/image.png`
## Setup
```
stack setup
stack build
env PORT=8080 HOSTNAME=localhost stack run tube-roundel &
curl -vv http://127.0.0.1:8080/roundel/no-text/445566/image.svg
```
## Deployment
You can run this directly as a Docker container which is built on
[Docker Hub](https://hub.docker.com/r/passy/tube-roundel/).
```
docker run --rm -p 127.0.0.1:8080:8080 passy/tube-roundel:$VERSION
```
Where `$VERSION` is the last published
[release](https://github.com/passy/tube-roundel/releases). To simplify the
build process, I directly publish the Travis artifacts and don't rebuild
inside the Docker container which is why I limit this to tagged releases.
One nice additional benefit of using a container is that building the font
cache is *much* faster than on a desktop machine as there are
*no fonts to cache*. Clearly, this is something that should be addressed in
code, but for now, it works.
## License
Licensed under 3-clause BSD.