This is a small web application that provides the dew point for forecast for a selected location. The dew point is the temperature at which dew forms as air is cooled. Knowing the dewpoint is good for determining how humid a day will feel.
This application is built with Rust using the Rocket web framework. It also makes use of the IP2Location DB for mapping IPs to countries. The database is available from https://lite.ip2location.com/database/db1-ip-country and should be placed in the root of the project.
There is a sample config file in Rocket.toml.sample
, copy this to
Rocket.toml
and add the two keys. For the OpenWeather API key you will need
to create an account at https://openweathermap.org/.
Configuration can also be done via environment variables, which is handy for prod deployment. See the Rocket documentation for details.
cargo build
The binary will be in target/debug/dewpoint
.
Add --release
to the build command:
cargo build --release
The binary will be in target/release/dewpoint
.
cargo run
Fast auto-rebuilding server:
watchexec -w src -w templates -s SIGINT -r 'mold -run cargo run'
Note:
- watchexec watches the file-system and runs a command when changes are detected
- mold is a fast linker for Linux.
This project is dual licenced under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.