-
Notifications
You must be signed in to change notification settings - Fork 12k
beta.11-webpack: No custom server routes possible? #1562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I need some more details here. What are you trying to do specifically? |
In the older angular-cli versions(1.0.0-beta.9) you could add an
Running Navigating to |
basically I need a way to integrate my backend server during development :) |
@niklas-dahl and others with this problem/question: We have found the easiest answer is to stop trying to make your front-end-development server (for example "ng serve") proxy to your API-server, and instead proxy the other way. Add a small feature to your API server to make it proxy to your front-end-development server. Depending on your server platform, this can take as little as a few lines of code. (For example, this is true with Node.) |
@kylecordes this is actually a great idea, thank you, never thought about this. Maby a small hint in the README would help a lot of people. But still a bit strange that this worked in earlier version of the cli.. |
@kylecordes @niklas-dahl Proxying from the backend is possible if we have control over the backend. But what if the backend is developed by a different team who are slow or negative to such propositions? In such cases we need to be able to proxy from the frontend dev server. |
@costis and others - here is a further workaround, for that situation (unfixable backend), or other more complex situations beyond what a future CLI proxy setting will handle: You have a computer, an infinitely programmable device. You can make your own development proxy, perhaps 15 lines of Node code, and proxy each kind of request however you need:
|
@niklas-dahl you're right that it worked previously, but only because it was a part of the I don't personally think it makes a whole lot of sense to serve the app and the API from the same server/subdomain, but understand that some setups do that. #1487 re-adds the webpack proxy, but doesn't give you the mini-api functionality. You can proxy to a simple API server though. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Windows 7
ng --version
. If there's nothing outputted, please runin a Terminal:
node --version
and paste the result here:angular-cli: 1.0.0-beta.11-webpack (on node v6.3.1)
do on your code? etc.
Added server/ folder
Added server/index.ts file
more information.
No failure, but the index.ts didnt get executed.
With the new build system, how can you install custom server routes?
The text was updated successfully, but these errors were encountered: