Posts

Technohub

Angular 14

You should know 3rd party dependency for angular.  Bootstrap Toaster Awesome-Fonts (Images ) Sweetalert2 1.    npmjs.com  You can go to website and search anything for library you get the result with npm command.  Example : bootstrap                 font-awesome for toaster or animation                     npm install ngx-toastr                npm install @angular/animations need to import BrowseAnimationModules from@platfomr/broser/animation in module.ts import { NgModule } from '@angular/core' ; import { BrowserModule } from '@angular/platform-browser' ; import { AppRoutingModule } from './app-routing.module' ; import { AppComponent } from './app.component' ; import { BrowserAnimationsModule } from '@angular/platform-browser/animations' import { ToastrModule } from 'ngx-toastr' ; @ NgModule ({   declarations : [     AppComponent   ],   imports : [     BrowserModule ,     AppRoutingModule ,     BrowserAnimationsModule

Running two docker container on same Network# Spring boot microservices # Docker # Docker Images #Docker Container

#consumer class TestController{ @Getmapping("data") public String getData(){ RestTemplate  t=new RestTemplate(); t.getforObject( "http://consumer:8080/getdata",String.class); } } FROM openjdk:8 EXPOSE 8080 ADD target/producer.jar producer.jar ENTRYPOINT ["java","-jar", "producer.jar"] #producer class TestController { @Getmapping("getdata") public String getData(){ return "This reponse comming from producer" } } FROM openjdk:8 EXPOSE 7000 ADD target/consumer.jar consumer.jar ENTRYPOINT ["java","-jar", "consumer.jar"] first craete network :   docker   create --network driver=bridge mynetwork (need correction from book) docker build -f  Dockerfile -t consumer (any name its just a tag name) . docker run -p 81:8080 --name=producer --network=mynetwork producer docker build -f  Dockerfile -t producer (any name its just a tag name) . docker run -p 82:7000 --name=consumer --network=mynetwork cons

What is staters ? How they Work ?

Spring boot provides the number of starters that allows us to add jars in classpath. Spring boot build in startes allowes us  develpoemrnt easier and rapid. Spring boot startes are the dependacy discriptor. In spring boot all the startes  follow same naming pattern spring-boot-starter-* Spring boot startes is combine a group of  common or related dependancies into single dependancy. Example :  Supoose if we want to create spring web application  with tomcat web server then we need to add following minimumn depednacies spring core jar, spring web,spring mvc, spring transaction jar  OK So Spring starter componenets combine  all the related jars into the single jar  file depenandcy to our build file  so insted of adding 4 jars we need to add only one jar in our project example spring -boot-startr-web By adding this spring boot automaticlly download all the related dependacies in our classpath

WebConfig Centralized Configuration In Microservices

 POM.xml  :     WebConfig Server :  -------------------------------------------------------------------------------------------------------------- <properties> <java.version>1.8</java.version> <spring-cloud.version>2020.0.3</spring-cloud.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-server</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <s

Auto Push Spring Boot App Image on Docker Hub Repository# 9561826040

 In this we will see how to create image and push on docker hub automatically.  I create simple Hello_World_Docker spring boot application and created one controller in it. package com.example.demo; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class WelcomeController { @RequestMapping("/wish") public String Wish() { return "HELLO GVOIND MANTRI"; } } command :  package dockerfile:build command :  package dockerfile:push command :  clean install ========================================================================================================================================= Pom.xml plugin <plugin> <groupId>com.spotify</groupId> <artifactId>dockerfile-maven-plugin</artifactId> <version>1.4.13</version> <executions> <execution> <id>default</id> <goals> &

Django Full Stack Developement - 2: Project Setting

After successful Django installation Create Project :     ⧫ django-admin startproject projectname Example : django-admin startproject FirstProject ⧫ Check created File  Example: ls ⧫  If you want to display  Tree Format structure tree -f ⧫ Start Server Example : python manage.py runserver ⧫ Default Server Started On 8080 Port Number , if you want to change port number (Not recommended) Example : python manage.py runserver 8888 ⧫ Django provide inbuilt Server and database ⧫ Create Application in Project Now         python manage.py startapp TestApp