Coder Social home page Coder Social logo

alexbbt / hna-projects-ii-23-24-tth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from holynamesacademy/projects-ii-23-24-tth

0.0 1.0 0.0 155 KB

This is a Hello World Web Server App built using Java Spring and Thymeleaf.

Java 79.48% HTML 20.52%

hna-projects-ii-23-24-tth's Introduction

HNAMAGOTCHI

This is a Web Server application, modified from the Spring MVC serving web content tutorial repository (found here). A Web Server is an application that receives HTTP requests and returns web pages. Spring is a framework that we use to write our web server. It implements a bunch of features that are common to all web servers so we can focus on the portions that unique to our application.

Team

  • Norah
  • Caitlin Roach
  • Chloe E.
  • Sophie Fong
  • Maddy
  • Natalie
  • Gabby H.
  • Freya

Getting Started

Here, we have a basic "Hello World" web server. Fork this repository to quickly get your project set up with some starter code.

The server works out of the box, and allows you to send 2 requests:

  • /: this is the home page of our website
  • /hello: this is a sub page that you can navigate to

Below are instructions to get the server running using 2 possible methods.

Via Command Line

Here are the steps to getting started via command line or terminal:

  1. Run git clone on your repo and then cd into the root folder of your repo.

  2. Run gradlew build to compile the application (On Windows .\gradlew build, on Mac ./gradlew build).

  3. Run graldew bootRun to run the server (Windows .\gradlew bootRun, Mac ./gradlew bootRun).

Via IntelliJ

Here are the steps to getting started via IntelliJ:

  1. Click on to File > New > Project from Version Control.

  2. Paste in the link to your GitHub repository. Click "Clone". If it asks you to chose between Gradle and Eclipse, choose Gradle.

  3. If you see a toast notification in the bottom right about Gradle ("IntelliJ IDEA found a Gradle build script"), select "Import Gradle project".

  4. Once the project loads, you can press the build button on the toolbar on the top right to compile the project, and you can press the play/debug buttons to run/debug the server.

Interacting with the Server

Once you run the server using either method above, you can send requests to the server and receive responses. The request you send will be in the form of a url (such as https://www.wikipedia.org) and the response you receive is an HTML document (plus CSS and JavaScript) that your browser parses to display the web page.

  1. Open a browser and navigate to http://localhost:8080/. localhost is a special keyword that tells the browser that the server is on your own computer instead of somewhere else on the internet. 8080 is the port number on your computer that the server is listening to and waiting for requests on. You should see a message that says "Get your greeting here".

  2. Navigate to http://localhost:8080/hello. The server sees /hello in the url and knows to give you a different HTML document than before. You should see "Hello, World!".

  3. Navigate to http://localhost:8080/hello?name=Bob. You should see "Hello, Bob!". You can change Bob in the url to a different name, and it should change the displayed message.

You now have the website up and running on your local computer. That's great because you can now develop features, make changes, and easily test them out, but the site is only visible on your computer. The next step is to deploy your website to the internet so everyone else can see it too.

Deploying Your App to Heroku

The very first task we will do after getting set up is to deploy our website. This means anyone will be able to access the website from their computer just like they can access https://www.wikipedia.org. We're going deploy first so that we can follow an agile methodology.That means we start with a working product, and then we add features as we go. Our product is always in a "complete" state, because we'll always have a working website.

In order to deploy the app, follow these steps:

  1. Go here and create a Heroku account. Get the account verified and then go to the Heroku dashboard.

  2. Select "Create new app". Give your app a name, and then select "Create App". The name you enter will be part of the url.

  3. In the "Deployment Method" section on the next page, click on GitHub and then "Connect to GitHub" and enter your GitHub info.

  4. Enter the name of the repo that you created above and then select "Connect".

  5. Select "Enable Automatic Deploys".

  6. Select "Deploy Branch".

  7. It will take a few minutes to deploy. In the meantime, you should see some logs being output, and a loading bar. Once deploy finishes, click "View". You should see your app deployed to an actual url (like https://hna-test.herokuapp.com).

  8. Your teammates should be able to access it from their computers, so give them the link and make sure it works. If you forget the link, you can always find it by going to the Heroku Dashboard, clicking on your app, and then selecting "Open App".

That's it! You have a working website! Of course the interesting -- and fun -- part comes next: turning your website into something unique and useful!

hna-projects-ii-23-24-tth's People

Contributors

hgotur avatar caitlinroach avatar ceid24 avatar maddynenn avatar nataliehatz avatar sf3990 avatar gabbyhi avatar nwall24 avatar freyamaddock avatar alexbbt avatar

Watchers

 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.