Environment Setup

Get started with AtlasX API Gateway

ดาวน์โหลดและติดตั้ง

AtlasX API Gateway สามารถดาวน์โหลดและติดตั้งได้อย่างง่ายผ่าน .NET CLI ที่ถูก Built-in มากับ .NET SDK โดย Developer สามารถดาวน์โหลดเทมเพลตมาติดตั้งไว้ที่เครื่องด้วยคำสั่ง

dotnet new install AtlasX.Api.Gateway.Templates \
  --nuget-source atlasx.cdg.co.th

สร้างโปรเจค API Gateway ด้วยคำสั่ง

dotnet new axgw --name MyProject.Api.Gateway

cd MyProject.Api.Gateway

dotnet clean
dotnet restore

หลังจากนั้น คุณสามารถทดสอบการใช้งานได้ โดยทำการรัน AtlasX Web Service ใดๆ ขึ้นมาที่ http://localhost:5000 จากนั้นทำการรัน API Gateway ขึ้นมาด้วยคำสั่งต่อไปนี้

dotnet run

จากนั้นทดสอบทำการส่ง Request ใดๆ ไปยัง API Gateway ที่ http://localhost:5220/api-gateway/api/appconfig เพื่อทดสอบการดึงค่าจาก controller AppConfig ที่เปิดให้เข้าถึงได้ผ่าน http://localhost:5000/api/appconfig