Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

testproject

Basit örnek: React ana sayfa, backend AppSettings:DisplayMessage değerini API üzerinden gösterir.

Yapı

  • backend/TestProject.Api — ASP.NET Core API (AppSettings:DisplayMessage, /health, /api/config)
  • backend/Greeting.Api — ayrı ASP.NET Core API (/health, /api/message → statik “Merhaba dünya”)
  • frontend — React (Vite); dist/ üretilmiş statik çıktı

Çalıştırma

Backend

cd backend/TestProject.Api
dotnet run
  • Health: http://localhost:8080/health
  • API: http://localhost:8080/api/config
  • Remote API örneği (IHttpClientFactory): http://localhost:8080/api/remote/google

TestProject.Api içinde Redis ve RabbitMQ istemcileri dependency injection'a kayıtlıdır. Varsayılan localhost ayarları appsettings.json dosyasındadır:

  • Redis: localhost:6379
  • RabbitMQ: amqp://guest:guest@localhost:5672/
  • Google remote API: https://www.google.com/

Redis ve RabbitMQ bağlantıları ihtiyaç duyulana kadar oluşturulmadığı için bu servisler kapalıyken de API başlatılabilir.

Konteyner / Docker imajında dinlenen port 8080 (ASPNETCORE_HTTP_PORTS).

Frontend (geliştirme)

cd frontend
npm install
npm run dev

Vite proxy: /api → http://localhost:8080, /greeting-api → http://localhost:8081

Greeting API (geliştirme)

cd backend/Greeting.Api
dotnet run
  • Health: http://localhost:8081/health
  • API: http://localhost:8081/api/message

Frontend build

cd frontend
npm install
npm run build

Ortam değişkenleri (Vault / deploy)

API, configuration key AppSettings:DisplayMessage okur. Linux konteyner / compose ortamında:

AppSettings__DisplayMessage=Vault'tan gelen metin

AppGraph vault binding:

Alan Değer
Anahtar AppSettings__DisplayMessage
Secret newproject (örnek)

Vault KV alan adı da aynı olmalı: AppSettings__DisplayMessage

Nginx

Production’da React fetch('/api/config') ve fetch('/greeting-api/api/message') kullanır; reverse proxy:

  • /api → TestProject.Api servisi
  • /greeting-api → Greeting.Api servisi (pass-through, path öneki korunur veya upstream’e rewrite edilir)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages