ApiService is a modern .NET 9 Web API that leverages OpenAPI for documentation and Swagger UI for interactive API exploration. It provides custom service defaults and integrates with Scalar for efficient data handling. Designed for scalability, maintainability, and ease of use, this project is an excellent starting point for building robust web APIs.
Why Use ApiService?
- 🚀 Rapid API Development – Pre-configured for fast API setup.
- 📖 Comprehensive Documentation – Automatically generates OpenAPI specs.
- ⚡ Interactive API Testing – Integrated Swagger UI & ReDoc.
- 🛠 Scalable & Customizable – Supports custom service defaults for flexibility.
✅ Built with .NET 9 – Leverages the latest ASP.NET Core innovations.
✅ OpenAPI Documentation – Provides standardized API specs.
✅ Swagger UI & ReDoc – Enables real-time API exploration & testing.
✅ Scalar Integration – Ensures efficient data handling.
✅ Custom Service Defaults – Allows customized configurations for services.
📌 src/ApiService – Main API project with controllers and configurations.
📌 src/ApiService/Services – Business logic and API services.
📌 src/ApiService/Endpoints – Defines RESTful API endpoints.
git clone https://github.com/MrEshboboyev/aspire-customization.git
cd ApiService
dotnet restore
dotnet build
dotnet run
Once the application is running, explore the API using:
🔹 Swagger UI – http://localhost:/swagger
🔹 ReDoc – http://localhost:/redoc
📝 Swagger UI provides an interactive API experience, allowing you to test endpoints directly.
🧐 ReDoc offers a beautifully structured API reference, making it easy to understand.
Method | Endpoint | Description |
---|---|---|
GET | /api/status |
Returns API health status |
GET | /api/data |
Fetches sample data |
POST | /api/data |
Submits new data |
PUT | /api/data/{id} |
Updates existing data |
DELETE | /api/data/{id} |
Removes a record |
Customize API settings in appsettings.json
:
{
"ApiSettings": {
"ServiceName": "ApiService",
"Version": "v1",
"EnableSwagger": true
}
}
Run tests to ensure API stability:
dotnet test
📌 Use Postman or Swagger UI to:
✅ Check API health → /api/status
✅ Fetch data → /api/data
✅ Submit data → /api/data (POST)
✅ Supercharged API Development – Reduces setup time & boosts productivity.
✅ Well-Documented & Interactive – Easily explore endpoints with Swagger & ReDoc.
✅ Scalable & Flexible – Supports custom service configurations.
✅ Built for .NET 9 – Utilizes latest performance improvements.
This project is licensed under the MIT License. See LICENSE for details.
For feedback, contributions, or questions:
📧 Email: [email protected]
💻 GitHub: MrEshboboyev
🚀 Start building scalable APIs with ApiService! Clone the repo & get started today!