Skip to content

Latest commit

 

History

History
60 lines (35 loc) · 1.39 KB

README.md

File metadata and controls

60 lines (35 loc) · 1.39 KB

coding-challenge-rust

build build

Create an API server using Axum which will return random animal facts. The service should have the following:

  • Receive the following inputs as arguments, environment variables, configuration, etc.

    • Port to start on

    • Type of fact to return with valid options

      • cat

      • dog

      • any (randomize the type on each request)

      • … assume more animals will be added in the future

    • Anything else you feel is needed

  • Have the endpoint /fact return a random fact

{
    "fact": "Three of the 12 dogs on the Titanic survived.",
    "animal": "dog"
}
  • Assume this is a production-grade application. So create:

    • Tests

    • Logs

    • Handle errors

    • etc.

To run the application:

cargo run

To test the application:

cargo test