DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Full-Stack Observability Essentials: Explore the fundamentals of system-wide observability and key components of the OpenTelemetry standard.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Improving Customer-Facing App Quality Using Tricentis Testim
  • What’s New in the Latest Version of Angular V15?
  • Keep Your Application Secrets Secret
  • React, Angular, and Vue.js: What’s the Technical Difference?

Trending

  • Slowing Down the Release Cycle
  • The Power of Visualization in Exploratory Data Analysis (EDA)
  • The Convergence of Testing and Observability
  • Log Analysis: How to Digest 15 Billion Logs Per Day and Keep Big Queries Within 1 Second
  1. DZone
  2. Data Engineering
  3. Databases
  4. Configure a Proxy for Your API Calls With Angular CLI [Video]

Configure a Proxy for Your API Calls With Angular CLI [Video]

Check out this video to learn how to configure the Angular CLI to proxy your API calls to your backend server.

Juri Strumpflohner user avatar by
Juri Strumpflohner
·
Nov. 10, 16 · Tutorial
Like (1)
Save
Tweet
Share
25.81K Views

Join the DZone community and get the full member experience.

Join For Free

In this video we will learn and demonstrate how to configure the Angular CLI to proxy your API calls to your backend server.

During development, you often end up in the situation where you have your backend API server running at one address (i.e. localhost:3000) while your frontend development server runs on another (i.e. localhost:4200). However, in your Angular 2 services that query the backend API, you don’t obviously want to hard-code the development server’s host, but instead, write your calls as follows:


this.http.get('/api/v1/people')
    .map(res => res.json());


Clearly, this won’t probably work out of the box, because the Angular CLI development server doesn’t answer at /api/v1/people with an API. This is why you need to have some kind of proxy that intercepts such calls and proxies them to your correct backend server API. Let’s learn how to setup such proxy with the Angular CLI.


You didn’t yet have the chance to create an Angular 2 application, but you’re eager to learn it? Watch my introductory video which learns you how to build your first Angular 2 application using the Angular CLI in under one hour.

API Command-line interface AngularJS

Published at DZone with permission of Juri Strumpflohner. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Improving Customer-Facing App Quality Using Tricentis Testim
  • What’s New in the Latest Version of Angular V15?
  • Keep Your Application Secrets Secret
  • React, Angular, and Vue.js: What’s the Technical Difference?

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: