# How to call backend on an aurelia-cli generated app

**URL:** <https://discourse.aurelia.io/t/how-to-call-backend-on-an-aurelia-cli-generated-app/3041>\
**Category:** Uncategorized\
**Created:** [November 2, 2019, 9:31pm UTC](https://discourse.aurelia.io/t/how-to-call-backend-on-an-aurelia-cli-generated-app/3041 "2019-11-02T21:31:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tutiplain](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@tutiplain](https://discourse.aurelia.io/u/tutiplain)\
**Post date:** [November 2, 2019, 9:31pm UTC](https://discourse.aurelia.io/t/how-to-call-backend-on-an-aurelia-cli-generated-app/3041/1 "2019-11-02T21:31:38Z")

</div>

HI all,

I am new to Aurelia, and I notice that when I type “au run” the aurelia app runs on its own local server at port 8080. However, I have my backend server already running on a separate node process at por 3000. I know that in production, the client files will be server from the same server so there shouldn’t be a problem, however, it seems like too much hassle to build for production just to test if my AJAX requests are working? In other frameworks (create-react-app, for example), it is possible to set up a proxy to redirect requests from one server to the other. Is there something similar in Aurelia-cli?

---

<div class="post-metadata">

**Author:** ![huochunpeng](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@huochunpeng](https://discourse.aurelia.io/u/huochunpeng)\
**Post date:** [November 2, 2019, 11:13pm UTC](https://discourse.aurelia.io/t/how-to-call-backend-on-an-aurelia-cli-generated-app/3041/2 "2019-11-02T23:13:33Z")

</div>

We don’t have proxy setup offered right now. I agree we need the setup plus doc.

Webpack dev server should have some proxy feature, you probably can find in webpack doc.

For cli built-in bundler, the setup uses browsersync as the dev server. It supports generic nodejs middleware such as proxy.

Here is an example how I use proxy in an app with cli built-in bundler. [https://stackoverflow.com/a/51182721/1375096](https://stackoverflow.com/a/51182721/1375096)

---

<div class="post-metadata">

**Author:** ![zewa666](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/zewa666/32/19_2.png) [@zewa666](https://discourse.aurelia.io/u/zewa666)\
**Post date:** [November 3, 2019, 6:46am UTC](https://discourse.aurelia.io/t/how-to-call-backend-on-an-aurelia-cli-generated-app/3041/3 "2019-11-03T06:46:37Z")

</div>

With regards to webpack here is a description about proxying requests for your backend “Proxying an external API with Webpack: Serve code and a RESTful data from separate endpoints.” von Gene Conroy-Jones [https://link.medium.com/VA7G6HP9i1](https://link.medium.com/VA7G6HP9i1)

---

<div class="post-metadata">

**Author:** ![tutiplain](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@tutiplain](https://discourse.aurelia.io/u/tutiplain)\
**Post date:** [November 5, 2019, 11:09pm UTC](https://discourse.aurelia.io/t/how-to-call-backend-on-an-aurelia-cli-generated-app/3041/4 "2019-11-05T23:09:06Z")

</div>

Thanks, I will try these out. I believe create-react-app’s proxy also uses the http-proxy-middleware npm module internally.
