This is a simple API built with Rust using the Rocket framework. It allows users to retrieve match data based on a specified date.
- Retrieve match data by date in the format
/DD/MM/YYYY. - Simple and easy-to-use API endpoints.
- Rust installed (version 1.65.0 or later)
- Cargo (Rust's package manager and build tool)
- Git
-
Clone the repository:
git clone https://github.com/your-username/match-api.git cd match-api -
Build the project:
cargo build
-
Run the project:
cargo run
Once the server is running, you can access it at http://localhost:8000.
-
GET
/Returns a welcome message and information about the API.
Example response:
{ "message": "Hello, you are using my API. You can get match data by adding the parameter /DD/MM/YYYY." } -
GET
/{DD}/{MM}/{YYYY}Retrieve match data for the specified date.
Example URL:
http://localhost:8000/16/06/2024Example response:
[ { "message": "connected", "team1": "Team A", "team2": "Team B", "scores": "2-1" }, { "message": "connected", "team1": "Team C", "team2": "Team D", "scores": "1-1" } ]
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
- GitHub: your-username
- Email: your-email@example.com