Skip to main content


Angular Routing Compete Guide

 Routes can be added at 2 place 1. In routing file - app-routing.module.ts 2. Any Module file like - app.module.ts file  1. In routing file - app-routing.module.ts 1. If we define in any module then we have to create a const like this  This appRoute should be specific type of Routes and this should be imported from  This should hold a array because we will have multiple routes  and we will add all the routes to this array and each route is just a javascript object in this array.  But question is how such route should be configured in angular app. It should follow some specific pattern or specific structure to angular use it. and this structure always need a path  path : this is what is mentioned in url after your domain name and this should be string . Like it could be users route so it should be like this  {path: 'users'}  common mistake is that never add / in the starting route like {path:'/users'} When you reach this what should happen if we don't define then not
Recent posts

how to install mysql in macbook m1 pro

 1. Download mysql and then install macos dmg file depending on your system and install it and while installing make sure you setup good passport for user "root" and password once you setup.  2. Export path in bash_profile like this -  export PATH="/usr/local/mysql/bin:$PATH" 3. Change your user to root user in macos by sudo -s 4. then run this command mahes@Mukeshs-MacBook-Pro ~ % sudo mysql -u root -h localhost -p Password: but this will not work we have to change user mahes to root by this command mahipal@Mukeshs-MacBook-Pro ~ % sudo -s Password: by entring system password root@Mukeshs-MacBook-Pro ~ # sudo mysql -u root -h localhost -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 19 Server version: 8.0.28 MySQL Community Server - GPL Copyright (c) 2000, 2022, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their res

How To Install Tomcat 9 and Java 8 on Amazon Linux 2

  Step 1: Install Java on Amazon Linux 2 Update and reboot the server 1) sudo yum -y update 2) sudo reboot 3) sudo yum install java-1.8.0-openjdk 4) java -version 5) wget here we can copy the path of tomcat version 6) sudo groupadd --system tomcat 7) sudo useradd -d /usr/share/tomcat -r -s /bin/false -g tomcat tomcat 8) sudo tar xvf apache-tomcat-9.0.43.tar.gz -C /usr/share/ 9) sudo mv apache-tomcat-9.0.43 tomcat 10) sudo chown -R tomcat:tomcat /usr/share/tomcat 11) sudo tee /etc/systemd/system/tomcat.service<<EOF [Unit] Description=Tomcat Server [Service] Type=forking User=tomcat Group=tomcat Environment=JAVA_HOME=/usr/lib/jvm/jre Environment='JAVA_OPTS=-Djava.awt.headless=true' Environment=CATALINA_HOME=/usr/share/tomcat Environment=CATALINA_BASE=/usr/share/tomcat Environment=CATALINA_PID=/usr/share/tomcat/temp/ Environment='C

how to redirect http request to https in application load balancer at aws

Why we want to do this - Means redirection of HTTP to https or non-www version to https://www version.  It's really helpful for SEO and the search engine has only one copy of your website. Otherwise, what happen Google/other search engine bots treat your website as a different website. So I am assuming that you have already had an AWS account and you have a running instance in it and your website already configured on Route 53 if not then you do it by yourself if you have any questions then you can write in the comment box.  Steps for Redirection of an HTTP request to HTTPS in Application Load Balancer at AWS Create an SSL certificate or use your own certificate in Certificate manager/IAM (it is required for application load balancer) Create an application load balancer  Configure security group (skips if its already open) Configure port 80 to redirection to 443  Set new DNS to your Route 53  First log in to AWS Account and Go to EC2 Instance and > Load Balancer Click on Create

Best Practice for css naming conventions and BEM rules

The  Block, Element, Modifier  methodology (commonly referred to as BEM) is a popular  naming convention  for classes in HTML and CSS. Developed by the team at Yandex, its goal is to help developers better understand the relationship between the HTML and CSS in a given project. Here’s an example of what a CSS developer writing in the BEM style might write: /* Block component */ .btn { } /* Element that depends upon the block */ .btn__price { } /* Modifier that changes the style of the block */ .btn--orange { } .btn--big { } In this CSS methodology a  block  is a top-level abstraction of a new component, for example, a button:  .btn { } . This block should be thought of as a parent. Child items, or  elements , can be placed inside and these are denoted by two underscores following the name of the block like  .btn__price { } . Finally,  modifiers  can manipulate the block so that we can theme or style that particular component without inflicting changes on a completely unre

BlogPosting Schema Markup to Blog Posts


WS Free Tier FAQs Q: What is the AWS Free Tier? The AWS Free Tier provides customers the ability to explore and try out AWS services free of charge up to specified limits for each service. The Free Tier is comprised of three different types of offerings, a 12-month Free Tier, an Always Free offer, and short term trials. Services with a 12-month Free Tier allow customers to use the product for free up to specified limits for one year from the date the account was created. Services with an Always Free offer allow customers to use the product for free up to specified limits as long as they are an AWS customer. Services with a short term trial are free to use for a specified period of time or up to a one-time limit depending on the service selected. Details on the limits and services provided for free are detailed in each card on the Free Tier page. If your application use exceeds the free tier limits, you simply pay standard, pay-as-you-go service rates (see each service page for full pri

How to determine the size of MySQL databases and tables

SELECT table_schema AS "Database", ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema; To determine the sizes of all of the tables in a specific database, at the mysql> prompt, type the following command. Replace database_name with the name of the database that you want to check: SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" FROM information_schema.TABLES WHERE table_schema = "database_name" ORDER BY (data_length + index_length) DESC;

Why we create separate model for request and response in rest api

We take separate model for request and response these are basically from UI point of view. Suppose we get the data from end user like : firstName, lastName, email, password. We get this data in JSON formate so we have to convert this JSON object to java object for that we create a separate model object in the package ui.model.request. and it will also used by spring framework to convert JSON object to Java object. Once we persist the data then we get some response back but in that response we. have like pkId of table but we don't want to send this in our response so we can't use a single entity that we used to perisit our data. So we create a new package with ui.model.response and we will copy that required fields and this will used to convert from Java object to JSON and it will be sent back to spring framework Here incoming request like from end user Now this incoming request received by method called createUser(); and @RequestBody annotation will take t