Coder Social home page Coder Social logo

webapp's Introduction

Spring Boot Web App

This is a simple Spring Boot web application. The application displays a "Welcome to Web App!" message and a button that, when clicked, shows a "Hello, World!" message.

Prerequisites

  • Java 17
  • Maven
  • Docker (optional)
  • Azure CLI (for deployment)
  • Existing Azure Web App (for deployment)

Build and Run

  1. Navigate to the project root directory (the same directory as the pom.xml file).
  2. Run the following command to build the application:
mvn clean package
  1. Run the following command to start the application:
mvn spring-boot:run
  1. Open a web browser and navigate to http://localhost:8080 to access the web application.

Running with Docker (optional)

  1. Build a Docker image of the application by executing the following command in the project root directory:
docker build --tag webapp .
  1. Run a Docker container with the built image:
docker run --name webapp --rm --port 8080:8080 webapp
  1. Access the web application at http://localhost:8080 in a web browser.

To stop the running container, find the container ID using docker ps, and then execute the command docker stop <container_id>.

Deploying to Azure App Services

  1. Log in to your Azure account using the following command:
az login
  1. Deploy the JAR file to the Web App:
az webapp deploy \
    --name <webapp-name> \
    --resource-group <resource-group-name> \
    --src-path target/webapp-0.0.1-SNAPSHOT.jar

Replace <WebAppName> with the name of your existing Azure Web App and <ResourceGroupName> with the name of the resource group associated with the web app.

  1. Open a web browser and navigate to https://<WebAppName>.azurewebsites.net to access the web application, where <WebAppName> is the name of the existing web app.

webapp's People

Watchers

Marina avatar

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.