Question: Angular2 configuration data with transform

Question

Angular2 configuration data with transform

Answers 0
Added at 2016-01-12 21:01
Tags
Question

I am creating an Angular2 application that will be using a webApi. What is the best practice for handling configuration data? I would like a way to do a transform as I deploy to different environments.

When working locally the webApi will be local such as: http://localhost:64551/Api/person.

In Dev it will be: http://devServer.com/Api/person

Prod will be: http://prodServer.com/Api/person

I can't hard-code the server name. I need it in a configuration, but it will change as we deploy to different environments.

This is an Anglar2 project that I am building inside an ASP.net 5 project using Visual Studio. The WebApi is an ASP.net 5 project. I will be hosting at Azure.

In the past, I have used web.config transforms but that's not an option for the angular app.

Any advice?

Answers
Source Show
◀ Wstecz