<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Arul Rozario on Medium]]></title>
        <description><![CDATA[Stories by Arul Rozario on Medium]]></description>
        <link>https://medium.com/@arul-rozario4?source=rss-2bc1bc4fe655------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Arul Rozario on Medium</title>
            <link>https://medium.com/@arul-rozario4?source=rss-2bc1bc4fe655------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 09:47:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arul-rozario4/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Angular: Switching environments while development without rerunning ng serve]]></title>
            <link>https://arul-rozario4.medium.com/angular-switching-environments-while-development-without-rerunning-ng-serve-3debcdaf40f7?source=rss-2bc1bc4fe655------2</link>
            <guid isPermaLink="false">https://medium.com/p/3debcdaf40f7</guid>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Arul Rozario]]></dc:creator>
            <pubDate>Fri, 19 Feb 2021 05:34:21 GMT</pubDate>
            <atom:updated>2021-02-19T05:40:43.542Z</atom:updated>
            <content:encoded><![CDATA[<h3>Angular: Switching environments while development without restarting ng serve</h3><p>Have you come across a situation when you have to debug your application connecting to a different environment like stage, demo or even production?<br>How do you handle environment switching in Angular.<br>Normally you stop<strong><em> ng serve</em></strong> then run <strong><em>ng serve — configuration=stage</em></strong> which will run the app with configurations in<em> </em><strong><em>enviroment.stage.ts.</em></strong> If your app is pretty large like ours with 5 applications and 20 libraries your <strong><em>ng serve</em></strong> is going to test your patience every time you have to switch between environments. I do that often for environment specific debugging. I suffered a lot waiting for <strong><em>ng serve</em></strong> to complete. One day I came up with a simple solution which let me switch between environments without re running ng serve. Here it is.<br>When you ng serve without specifying any configuration angular uses the configuration in <strong><em>environment.ts. </em></strong>And whenever there is a change in any of the files ng serve will compile only the changes which is quick. Let’s make use of these two.<br>Create environment specific files like</p><pre>environment.dev.ts<br>environment.stage.ts<br>environment.production.ts</pre><p>put all your configuration variables in those files.</p><p>then in environment.ts</p><pre>// import { environment as env } from ‘./environment.prod’;</pre><pre>// import { environment as env } from ‘./environment.stage’;</pre><pre>import { environment as env } from ‘./environment.dev’;</pre><pre>export const environment = { …env, production: false };</pre><p>now when you wanna switch environments just uncomment the environment you want to run and comment others. ng serve is happy switching the environment for you instantly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3debcdaf40f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>