Category - Beginners

Host the Angular Application to IIS
Jan 23, 2024

Hosting an Angular application on IIS involves a few straightforward steps.    Follow this step-by-step guide to seamlessly deploy your Angular project on IIS. Step 1: Open Your Angular Project in Visual Studio Code Review the build command in the package.json file. By default, it's usually set to ng build. Step 2: Run the Build Command Execute the ng build command in the terminal to compile your Angular application.  This command creates a 'dist' folder, typically located at the specified output path in the angular.json file. Step 3: Install IIS Ensure that IIS is installed on your machine. You can install it through the "Turn Windows features on or off" option in the Control Panel. Step 4: Create a New Site in IIS Open the IIS Manager. In the Connections pane, right-click on the "Sites" node and select "Add Website." Fill in the required information, such as the Site name, Physical path to the folder , and choose a port. Step 5: Configure URL Rewrite (Optional) If your Angular application uses routing, consider configuring URL Rewrite for proper routing.  Create a 'web.config' file in your 'dist' folder with the appropriate configurations. Here's a simple example of a web.config file for an Angular application with routing.This file helps configure how the server handles URL requests. ---------------------------------------------------------------------------------------------------------------- <?xml version="1.0" encoding="utf-8"?> <configuration>   <system.webServer>     <rewrite>       <rules>         <rule name="Angular Routes" stopProcessing="true">           <match url=".*" />           <conditions logicalGrouping="MatchAll">             <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />           </conditions>           <action type="Rewrite" url="/" />         </rule>       </rules>     </rewrite>     <staticContent>       <remove fileExtension=".json" />       <mimeMap fileExtension=".json" mimeType="application/json" />     </staticContent>   </system.webServer> </configuration> ---------------------------------------------------------------------------------------------------------------- Step 6: Restart IIS After making these changes, restart IIS to apply the configurations. Step 7: Access Your Angular Application Open a web browser and navigate to http://localhost:yourport (replace 'yourport' with the specified port from Step 4). Now, your Angular application is hosted on IIS. Access it through the specified port. If any issues arise, check the IIS logs for more information.  Customize these instructions based on your specific requirements and environment. Thanks!

Docker Simplified: for Beginners
Dec 05, 2022

What Is a Docker? Let’s Say you created an application, and that’s working fine in your machine.??????? Figure 1: App Working Fine   But in production it doesn’t work properly, developers experience it a lot. Figure 2: Not Working in Production   That is when the developer’s famous words are spoken Client: Your application is not working Developer: It works on my machine Figure 3: Client Developer   The Reason could be due to: Dependencies Libraries and versions Framework OS Level features Microservices That the developer’s machine has but not there in the production environment.   We need a standardized way to package the application with its dependencies and deploy it on any environment. Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Figure 4: Docker Icon   How does docker work? Docker packages an application and all its dependencies in a virtual container that can run on any server. Figure 5: Container   Each container runs as an isolated process in the user space and take up less space than regular VMs due to their layered architecture. Figure 6: Architecture   So, it will always work the same regardless of its environment. Credit Goes to @codechips