From fa90ae0845afd6637d3365324b4c166d516f2b49 Mon Sep 17 00:00:00 2001 From: Rijul Shrestha Date: Thu, 23 Oct 2025 10:42:41 +0100 Subject: [PATCH 1/2] Standardize local hosting command to 'npx http-server -p 8080' --- .../src/content/docs/10-getting-started/01-Java-applet.mdx | 3 +-- sites/cheerpj/src/content/docs/10-getting-started/03-JNLP.mdx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sites/cheerpj/src/content/docs/10-getting-started/01-Java-applet.mdx b/sites/cheerpj/src/content/docs/10-getting-started/01-Java-applet.mdx index 71f77e5e..cec0d9e9 100644 --- a/sites/cheerpj/src/content/docs/10-getting-started/01-Java-applet.mdx +++ b/sites/cheerpj/src/content/docs/10-getting-started/01-Java-applet.mdx @@ -81,8 +81,7 @@ For example: You can now serve this web page on a simple HTTP server, such as the http-server utility. ```shell -npm install http-server -http-server -p 8080 +npx http-server -p 8080 ``` > In case your users have a native Java plugin installed, you can replace the original HTML tag with a `cheerpj-` prefixed version. ``, ``, and `` are all supported. diff --git a/sites/cheerpj/src/content/docs/10-getting-started/03-JNLP.mdx b/sites/cheerpj/src/content/docs/10-getting-started/03-JNLP.mdx index c4546356..9b78f0c6 100644 --- a/sites/cheerpj/src/content/docs/10-getting-started/03-JNLP.mdx +++ b/sites/cheerpj/src/content/docs/10-getting-started/03-JNLP.mdx @@ -214,8 +214,7 @@ You can now go to the project directory and serve this web page on a simple HTTP ```sh cd directory_name -npm install http-server -http-server -p 8080 +npx http-server -p 8080 ``` ## The end From d7b6555b4b1b1badacf46eabf88de74405711c65 Mon Sep 17 00:00:00 2001 From: Rijul Shrestha Date: Thu, 23 Oct 2025 10:50:44 +0100 Subject: [PATCH 2/2] Standardize local hosting instruction and command --- .../src/content/docs/13-tutorials/00-swingset3.mdx | 8 ++++++++ sites/cheerpj/src/content/docs/13-tutorials/01-applet.mdx | 5 +++-- sites/cheerpj/src/content/docs/13-tutorials/02-jnlp.mdx | 5 ++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/sites/cheerpj/src/content/docs/13-tutorials/00-swingset3.mdx b/sites/cheerpj/src/content/docs/13-tutorials/00-swingset3.mdx index f2d25c37..b9b9c0ff 100644 --- a/sites/cheerpj/src/content/docs/13-tutorials/00-swingset3.mdx +++ b/sites/cheerpj/src/content/docs/13-tutorials/00-swingset3.mdx @@ -42,6 +42,14 @@ npx vite Visit the URL shown in the terminal and you should see a blank page. Leave Vite running in the background for the remainder of this tutorial. +Alternatively you can also use the http-server utility. + +```sh +npx http-server -p 8080 +``` + +Open a browser tab pointing to your localhost such as `http://127.0.0.1:8080/`. + ## 2. Add CheerpJ to the document Let's add CheerpJ to the page by adding this script tag to the ``: diff --git a/sites/cheerpj/src/content/docs/13-tutorials/01-applet.mdx b/sites/cheerpj/src/content/docs/13-tutorials/01-applet.mdx index 9170d206..24708488 100644 --- a/sites/cheerpj/src/content/docs/13-tutorials/01-applet.mdx +++ b/sites/cheerpj/src/content/docs/13-tutorials/01-applet.mdx @@ -32,11 +32,12 @@ To view the example, we need to host the files on a web server. [Vite](https://v npx vite ``` +Visit the URL shown in the terminal and you should see a blank page. Leave Vite running in the background for the remainder of this tutorial. + Alternatively you can also use the http-server utility. ```sh -npm install http-server -http-server -p 8080 +npx http-server -p 8080 ``` Open a browser tab pointing to your localhost such as `http://127.0.0.1:8080/`. diff --git a/sites/cheerpj/src/content/docs/13-tutorials/02-jnlp.mdx b/sites/cheerpj/src/content/docs/13-tutorials/02-jnlp.mdx index a9ee403f..39f1e23b 100644 --- a/sites/cheerpj/src/content/docs/13-tutorials/02-jnlp.mdx +++ b/sites/cheerpj/src/content/docs/13-tutorials/02-jnlp.mdx @@ -167,11 +167,10 @@ npx vite Alternatively you can also use the http-server utility: ```sh -npm install http-server -http-server -p 8080 +npx http-server -p 8080 ``` -Visit the address indicated by your http-server in the browser. For example, `http://localhost:8080`. +Open a browser tab pointing to your localhost such as `http://127.0.0.1:8080/`. ### The result