nhymxu / url-shortener-rust

Simple URL shortener writing using Rust
0 stars 0 forks source link

protect `/short` endpoint #2

Open nhymxu opened 2 years ago

nhymxu commented 2 years ago

Simple implement add api_key to body and compare with pre-defined key inside program.

If match => save to DB If not match => return "not have permission" message

nhymxu commented 1 year ago

Can save API key to .env file using dotenv = "0.15.0"