Skip to content

Commit

Permalink
README improvements (#108)
Browse files Browse the repository at this point in the history
* Add a bit more help for the newcomer

* Fix typo

* Update README.md

* Update README.md
  • Loading branch information
thbar authored Jan 18, 2021
1 parent 791c4eb commit d7a7b86
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,30 @@ Then you can build it:
cargo build
```

### Running
### Configuring & Running

You can check the needed cli parameters with the `-h` option:
```
cargo run --release -- -h
```

Note: an example configuration file can be seen [here](example_configuration_file.yml).
In particular, the application expects a config file from you, to define which datasets (GTFS + GTFS RT) should be handled.

This can be configured via a local file, or a HTTP url (see `-h` output for exact details).

An example configuration file can be found in [here](example_configuration_file.yml), which you can use like this (in debug mode):

```
cargo run -- -c example_configuration_file.yml
```

After a bit of time preparing the datasets, an url will appear in the logs (`http://localhost:8080`), showing which datasets are served.

Alternatively, you can use:

```
cargo run -- --gtfs <path or url of gtfs> --url <url fo the gtfs rt>
```

### Testing

Expand All @@ -73,6 +89,19 @@ make check

It will save you some time for the code review and continous integration ;)

### Manual testing

One useful trick to experiment locally is to [serve a local folder via HTTP](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server#running_a_simple_local_http_server), using:

```
mkdir data
cd data
# here download files with curl or manually, then start server
python3 -m http.server
```

You can use the corresponding urls in a custom `.yml` configuration file. This makes it easier to simulate 404 errors for instance (by simply renaming the files).

## Architecture

The API has been made with [actix-web](https://github.com/actix/actix-web). This makes it possible to have a multithreaded API with data reloading and realtime updates without dataraces (thanks to [rust](https://www.rust-lang.org/)), nor mutexes (thanks to the [actix](https://github.com/actix/actix) [actor model](https://en.wikipedia.org/wiki/Actor_model)).
Expand Down

0 comments on commit d7a7b86

Please sign in to comment.