Skip to content

Commit a9fd43e

Browse files
committed
Update README.md for clarity and improved instructions on running the weather app
1 parent e49d8fd commit a9fd43e

1 file changed

Lines changed: 32 additions & 25 deletions

File tree

README.md

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,52 @@
11
# GitHub Codespaces ♥️ Java
22

3-
This repository is a weather app built on the JDK 25 built-in HTTP server.
3+
Want to try out Java for web development?
44

5-
It serves:
6-
- a REST API at `/api/weatherforecast`
7-
- static frontend assets (`index.html`, CSS, JavaScript)
5+
This repo builds a Weather API and a web frontend in a single Java project using the JDK 25 built-in HTTP server (`jdk.httpserver`).
86

9-
## Run
7+
You get both backend and frontend in one place, and where you go from here is up to you.
108

11-
1. Compile:
9+
Everything you do here is contained within this one codespace. There is no repository on GitHub yet. If and when you’re ready you can click "Publish Branch" and we’ll create your repository and push up your project. If you were just exploring then and have no further need for this code then you can simply delete your codespace and it’s gone forever.
1210

13-
mvn compile -f sample-app/pom.xml
11+
### Run Options
1412

15-
2. Start:
13+
[![Open in GitHub Codespaces](https://img.shields.io/static/v1?style=for-the-badge&label=GitHub+Codespaces&message=Open&color=lightgrey&logo=github)](https://codespaces.new/github/java-codespaces)
14+
[![Open in Dev Container](https://img.shields.io/static/v1?style=for-the-badge&label=Dev+Container&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/github/java-codespaces)
1615

17-
java --module-path sample-app/target/classes --module com.example.app/com.example.app.Application
16+
You can also run this repository locally by following these instructions:
17+
1. Clone the repo to your local machine `git clone https://github.com/github/java-codespaces`
18+
1. Open repo in VS Code
1819

19-
3. Open in browser:
20+
## Getting started
2021

21-
http://localhost:8080
22-
23-
## API
24-
25-
- `GET /api/weatherforecast` returns a 5-day forecast JSON payload.
22+
1. **📤 One-click setup**: [Open a new Codespace](https://codespaces.new/github/java-codespaces), giving you a fully configured cloud developer environment.
23+
2. **▶️ Build and run**:
24+
- Compile: `mvn compile -f sample-app/pom.xml`
25+
- Start: `java --module-path sample-app/target/classes --module com.example.app/com.example.app.Application`
26+
3. Open the forwarded port **8080** in your browser.
27+
- Web app: `/`
28+
- API endpoint: `/api/weatherforecast`
29+
4. **🔄 Iterate quickly:** Update Java, HTML, CSS, or JavaScript files and rerun as needed while using VS Code debugging tools.
30+
5. To stop running, return to VS Code and stop the running process/task.
2631

2732
## Project Structure
2833

2934
```
3035
sample-app/
3136
├── pom.xml
3237
└── src/main/
33-
├── java/com/example/app/
34-
│ ├── Application.java
35-
│ ├── StaticFileHandler.java
36-
│ ├── WeatherForecast.java
37-
│ ├── WeatherForecastService.java
38-
│ └── WeatherHttpServer.java
39-
└── resources/static/
40-
├── index.html
41-
├── css/site.css
42-
└── js/app.js
38+
├── java/
39+
│ ├── module-info.java
40+
│ └── com/example/app/
41+
│ ├── Application.java
42+
│ ├── StaticFileHandler.java
43+
│ ├── WeatherForecast.java
44+
│ ├── WeatherForecastService.java
45+
│ └── WeatherHttpServer.java
46+
└── resources/static/
47+
├── index.html
48+
├── css/site.css
49+
└── js/app.js
4350
```
4451

4552
## Tech Stack

0 commit comments

Comments
 (0)