Skip to content

Commit 81ac93e

Browse files
Standardize local hosting instructions in Getting Started and Tutorials (#292)
1 parent ad7b7eb commit 81ac93e

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

sites/cheerpj/src/content/docs/10-getting-started/01-Java-applet.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ For example:
8181
You can now serve this web page on a simple HTTP server, such as the http-server utility.
8282

8383
```shell
84-
npm install http-server
85-
http-server -p 8080
84+
npx http-server -p 8080
8685
```
8786

8887
> In case your users have a native Java plugin installed, you can replace the original HTML tag with a `cheerpj-` prefixed version. `<cheerpj-applet>`, `<cheerpj-object>`, and `<cheerpj-embed>` are all supported.

sites/cheerpj/src/content/docs/10-getting-started/03-JNLP.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@ You can now go to the project directory and serve this web page on a simple HTTP
214214

215215
```sh
216216
cd directory_name
217-
npm install http-server
218-
http-server -p 8080
217+
npx http-server -p 8080
219218
```
220219

221220
## The end

sites/cheerpj/src/content/docs/13-tutorials/00-swingset3.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ npx vite
4242

4343
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.
4444

45+
Alternatively you can also use the http-server utility.
46+
47+
```sh
48+
npx http-server -p 8080
49+
```
50+
51+
Open a browser tab pointing to your localhost such as `http://127.0.0.1:8080/`.
52+
4553
## 2. Add CheerpJ to the document
4654

4755
Let's add CheerpJ to the page by adding this script tag to the `<head>`:

sites/cheerpj/src/content/docs/13-tutorials/01-applet.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ To view the example, we need to host the files on a web server. [Vite](https://v
3232
npx vite
3333
```
3434

35+
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.
36+
3537
Alternatively you can also use the http-server utility.
3638

3739
```sh
38-
npm install http-server
39-
http-server -p 8080
40+
npx http-server -p 8080
4041
```
4142

4243
Open a browser tab pointing to your localhost such as `http://127.0.0.1:8080/`.

sites/cheerpj/src/content/docs/13-tutorials/02-jnlp.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,10 @@ npx vite
167167
Alternatively you can also use the http-server utility:
168168

169169
```sh
170-
npm install http-server
171-
http-server -p 8080
170+
npx http-server -p 8080
172171
```
173172

174-
Visit the address indicated by your http-server in the browser. For example, `http://localhost:8080`.
173+
Open a browser tab pointing to your localhost such as `http://127.0.0.1:8080/`.
175174

176175
### The result
177176

0 commit comments

Comments
 (0)