Small but production-ready webservice in Rust, using Actix web framework.
AGPL-3.0 License
Small but production-ready webservice in Rust, using Actix web framework.
The service implements an API specification of one feature for goout.net platform. It was shadow-developed alongside main implementation in Kotlin http4k made by @goodhoko at GoOut for comparison and joy.
Multiple implementations of this service exist in different frameworks, languages for comparison.
To play/develop:
cargo build
target/debug/locations-rs
--release
to compile with optimizations (into target/release/
)cargo run
cargo test
cargo check
cargo clippy
cargo fix
cargo fmt -- --check
cargo fmt
cargo doc --no-deps
target/doc/locations-rs/index.html
cargo watch -x clippy -x test -x 'fmt -- --check' -x 'doc --no-deps' -x run
The locations service needs an Elasticsearch instance to operate. The instance should contain
indices city
and region
filled with some data. The GOOUT_ELASTIC_HOST
and GOOUT_ELASTIC_PORT
(usually 9200
) environment variables need to point to the instance.
This repository contains elasticsearch
directory with ready-made dockerized
Elasticsearch instance pre-filled with data. Simply set GOOUT_ELASTIC_HOST
to a host that runs the
Docker image. Note that if both locations and Elasticsearch run in separate Docker containers, one
needs to point locations to host address like 172.17.0.1
(GOOUT_ELASTIC_HOST
of 127.0.0.1
or
0.0.0.0
won't work).
The directory also contains mapping definitions of the 2 indices and example data.
This project is licensed under GNU Affero General Public License, version 3.