Git Product home page Git Product logo

radualexandrub / springboot-angular-server-ping-status-tracker Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 9.6 MB

Web-based application that allows users to monitor servers availability in a local network by performing ping tests and displaying their up/down status.

License: MIT License

Java 27.15% TypeScript 46.23% HTML 19.81% CSS 4.20% Dockerfile 2.61%
angular docker-compose java mysql rest-api springboot

springboot-angular-server-ping-status-tracker's Introduction

Hi, I'm Radu!

I'm passionate about Full-Stack Development, Mobile Applications and Computer Vision.
When I'm learning or starting a new project, I begin with the big picture, and then add the details, so I can return professional and elegant results!

Radu Alexandru B Stats

Programming Languages:
JavaScript TypeScript Java SQL

Frameworks & Tools:
Angular React Spring Django Wordpress Keras
Jupyter Notebook Git Linux Figma Adobe Lightroom Adobe Photoshop

Markup & Styling:
HTML5 CSS3 Markdown LaTeX

๐ŸŒ My portfolio: radubulai.com

๐Ÿฅ‚ Social:
radualexandrub RaduAlexandruB RaduAlexandruB

springboot-angular-server-ping-status-tracker's People

Contributors

radualexandrub avatar

Stargazers

 avatar

Watchers

 avatar  avatar

springboot-angular-server-ping-status-tracker's Issues

Hardcoded localhost for API_URL and ALLOWED_ORIGINS URL for CORS

Issue: When running the application via Docker compose on a separate Server/VM, the Angular FrontEnd UI cannot be used as it's always pointing to "localhost" baseApiUrl. Also, the BackEnd Spring Boot REST API has hardcoded "localhost" URLs for setAllowedOrigins in its CORS configuration.

Environment: Docker compose on Redhat 8.9 VM running on Windows "Hyper-V Manager"

cat /etc/redhat-release
# Red Hat Enterprise Linux release 8.9 (Ootpa)

ip addr show eth0
# inet 172.23.100.64

sudo yum list installed | grep "docker"
# containerd.io.x86_64              1.6.28-3.1.el8  @docker-ce-stable
# docker-buildx-plugin.x86_64       0.12.1-1.el8    @docker-ce-stable
# docker-ce.x86_64                  3:25.0.3-1.el8  @docker-ce-stable
# docker-ce-cli.x86_64              1:25.0.3-1.el8  @docker-ce-stable
# docker-ce-rootless-extras.x86_64  25.0.3-1.el8    @docker-ce-stable
# docker-compose-plugin.x86_64      2.24.6-1.el8    @docker-ce-stable

Expected Result:

  • Web application should retrieve the servers from backend REST API and work as expected.

Actual Result:

  • The servers from backend REST API could not be retrieved. UI error shows:
Error: Error Code: 0, Message: Http failure response for http://localhost:8080/api/servers: 0 Unknown Error

Notes:

CT_Hardcoded_localhost_API_URL_issue

Useful commands:

# Fix for
# ERROR [spring-api build 6/9] RUN ./mvnw dependency:go-offline -B
# > [spring-api build 6/9] RUN ./mvnw dependency:go-offline -B:
# 0.194 /bin/sh: 1: ./mvnw: Permission denied
chmod +x mvnw
# Revert to original code:
git stash save "Fix hardcoded API_URL and ALLOWED_ORIGINS URL for CORS"
git stash list
git stash pop
docker compose build angular-client
docker compose build spring-api

docker compose up -d mysql-db
docker compose logs -f mysql-db

docker compose up -d
docker compose logs -f angular-client spring-api
docker compose logs -f angular-client
docker compose logs -f spring-api
docker ps -a
docker compose down -v --remove-orphans
docker container prune -a 

docker image ls
docker image prune -a
# docker system prune -a

https://stackoverflow.com/questions/35228970/docker-compose-build-single-container

(Saturday, March 02, 2024)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.