Angular App and Spring Boot Api for Country, State and City
Ashish Agre
Posted on May 19, 2020
Introduction
Address WebApi and test example to display
Country, State and City
Prerequisite
- Java SDK
- node.js
Building Backend
https://gitlab.com/address-api/api-server.git
Create Database in mysql create database address_api_db;
Export Env variable
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_SECRET=my_super_secret_password
Execute maven command to run project
./mvnw spring-boot:run
API Details
Name | Path |
---|---|
All Countries | http://localhost:8080/country/all |
State By Country | http://localhost:8080/state/all?countryId={countryId} |
City By State | http://localhost:8080/city/all?stateId={stateId} |
Building Frontend
https://gitlab.com/address-api/frontend.git
Build
ng build
Run
ng serve
Navigate to http://localhost:4200
Demo
Ref:
Thanks to https://github.com/hiiamrohit/Countries-States-Cities-database 🙇
Source
https://silentsudo.gitlab.io/post/angular/2020-05-19-api-country-state-city/
💖 💪 🙅 🚩
Ashish Agre
Posted on May 19, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.