Angular Tips: Base API URL ด้วย Interceptor
วันนี้มี Tip เล็กๆที่มาจาก วันก่อนเจอ ยิ้ม ถามว่า HttpClient ของ Angular ไม่มีให้เซ็ท Base API URL เหรอ ? ก็ตอบด้วยความมั่นใจว่า “ไม่รู้” lol … จากนั้นด้วยความข้องใจก็เลยไปลองๆหาดูเลยได้ท่านี้มาแชร์กัน
มาดูตัวอย่างกัน