You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That warning is intentional. The dev server is served using the --host and --port options specified. The dev server path cannot be an absolute path as it is combined with the host and port options to create the full address. As such it defaults to serving from the root of the configured host and port when it cannot calculate the serving path using the deploy URL and base HREF supplied.
Also, for the example path shown above, setting the port to 32323 would allow the application to be accessed from http://localhost:32323/.
@clydin That's why I need to set absolute path on --deploy-url. I came out a solution to integrate Angular CLI project into ASP.NET MVC. In ng serve mode, the application is hosted in IIS Express (assume the port number is 4201), and it's rendering index.html content. I need to also emit scripts and styles that are hosted in dev server (assume port number is 4200) to make automatic build works. Without setting webpack's public path variable, I will get errors as the Angular/Angular CLI think the scripts are hosted in 4201.
I know Angular CLI is hiding many complexities of Webpack, --deploy-url is only parameter I found that can change webpack public path (__webpack_require.p), I don't know why you don't like absolute path set to this parameter
If IIS is the client facing server then for development it should be configured to forward the necessary requests to the CLI's dev server. Assuming the application would then be hosted on IIS in some form in production, this would then mimic the production environment.
Also, note that the deploy URL and/or base HREF settings are actually used to generate the application. The dev server just cannot use them to serve the application as explained above.
The setting is only for ng serve and hmr mode. I just use dev server to do browser reloading and serving on-the-fly build output. It would be much appreciated if you can support absolute path or shed light for me how to host angular app in ASP.NET MVC and support ng serve
Activity
clydin commentedon Dec 12, 2017
That warning is intentional. The dev server is served using the
--hostand--portoptions specified. The dev server path cannot be an absolute path as it is combined with the host and port options to create the full address. As such it defaults to serving from the root of the configured host and port when it cannot calculate the serving path using the deploy URL and base HREF supplied.Also, for the example path shown above, setting the port to 32323 would allow the application to be accessed from
http://localhost:32323/.feng-xiao commentedon Dec 12, 2017
@clydin Does --host and --port set the concatenated value to webpack_require.p variable?
clydin commentedon Dec 12, 2017
--host,--port, and--serve-pathare dev server only settings and have no effect on the built output.feng-xiao commentedon Dec 12, 2017
@clydin That's why I need to set absolute path on --deploy-url. I came out a solution to integrate Angular CLI project into ASP.NET MVC. In ng serve mode, the application is hosted in IIS Express (assume the port number is 4201), and it's rendering index.html content. I need to also emit scripts and styles that are hosted in dev server (assume port number is 4200) to make automatic build works. Without setting webpack's public path variable, I will get errors as the Angular/Angular CLI think the scripts are hosted in 4201.
I know Angular CLI is hiding many complexities of Webpack, --deploy-url is only parameter I found that can change webpack public path (__webpack_require.p), I don't know why you don't like absolute path set to this parameter
clydin commentedon Dec 12, 2017
If IIS is the client facing server then for development it should be configured to forward the necessary requests to the CLI's dev server. Assuming the application would then be hosted on IIS in some form in production, this would then mimic the production environment.
Also, note that the deploy URL and/or base HREF settings are actually used to generate the application. The dev server just cannot use them to serve the application as explained above.
feng-xiao commentedon Dec 12, 2017
The setting is only for
ng serveandhmrmode. I just use dev server to do browser reloading and serving on-the-fly build output. It would be much appreciated if you can support absolute path or shed light for me how to host angular app in ASP.NET MVC and supportng serveclydin commentedon Dec 12, 2017
To clarify, are you saying it doesn't work when using deploy URL or that you don't want to see the warning?
feng-xiao commentedon Dec 12, 2017
It's working so far. I just don't want to see the warning, and I hope the absolute value won't break other stuff.
angular-automatic-lock-bot commentedon Sep 7, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.