Skip to content

Commit 8f1420a

Browse files
committed
prettier
1 parent 1425b92 commit 8f1420a

File tree

13 files changed

+40
-32
lines changed

13 files changed

+40
-32
lines changed

sites/browserpod/src/content/docs/00-overview.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ import { DISCORD_URL } from "@/consts.ts";
3333
Instead of provisioning a cloud server, BrowserPod's API enables a client browser to host full runtimes compiled to WebAssembly (Wasm), running at native speed.
3434

3535
<div class="m-4 flex justify-center">
36-
[Get started](/docs/getting-started/quickstart) · [Basic Tutorial](/docs/getting-started/expressjs) · [API reference](/docs/reference) · [GitHub
37-
repository](https://github.com/leaningtech/browserpod-meta)
38-
· [Licensing](/docs/more/licensing)
36+
[Get started](/docs/getting-started/quickstart) · [Basic
37+
Tutorial](/docs/getting-started/expressjs) · [API reference](/docs/reference)
38+
· [GitHub repository](https://github.com/leaningtech/browserpod-meta) ·
39+
[Licensing](/docs/more/licensing)
3940
</div>
4041

4142
BrowserPod is ephemeral by design. Each **pod** (_see [pod](/docs/more/glossary#pod)_) runs inside a browser tab and ends when the tab closes or reloads. Because BrowserPod runs inside the browser, each Pod is constrained by the browser’s security model, isolated from the user’s OS, with limited access (via syscalls) to local files or system resources unless you explicitly provide it.
@@ -64,8 +65,6 @@ Everything runs client‑side within the browser sandbox, so users don’t need
6465
- **Security**: The BrowserPod API boots instances in the browser's sandbox, inheriting its security.
6566
- **Cost**: Because BrowserPod runs instances in the browser, it comes at a fraction of the cost of cloud sandboxes, with a generous free tier.
6667

67-
68-
6968
## How it works (high level)
7069

7170
- BrowserPod ships a build of Node.js that targets CheerpOS (a runtime that provides a Linux‑like syscall interface to Wasm).
@@ -79,7 +78,6 @@ See the [hosting guide](/docs/guides/hosting) for details on headers and setup.
7978

8079
BrowserPod currently supports Node.js runtime, support for Python and Ruby is coming soon.
8180

82-
8381
## Community and support
8482

8583
<LinkButton

sites/browserpod/src/content/docs/10-getting-started/01-quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ npm install
2727
npm run dev
2828
```
2929

30-
Then, open your localhost (for example, [http://localhost:5173/](http://localhost:5173/)) in your browser, and you should
30+
Then, open your localhost (for example, [http://localhost:5173/](http://localhost:5173/)) in your browser, and you should
3131
see something like this:
3232

3333
![Output of the basic template](/docs/assets/bp-quickstart.png)

sites/browserpod/src/content/docs/10-getting-started/02-expressjs.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ title: Set up a basic NPM-based project
33
description: In this tutorial you will set up a simple NPM project that runs an HTTP server using Express.js
44
---
55

6-
7-
86
During this tutorial we will set up a basic project that uses BrowserPod to run
97
a web server application entirely client side in the Browser.
108

@@ -13,7 +11,7 @@ a web server application entirely client side in the Browser.
1311
You can get the source by running `npm create browserpod-quickstart@latest` and
1412
selecting the "Web Server" template.
1513

16-
### Project structure
14+
### Project structure
1715

1816
The project consists of the following files and directories:
1917

@@ -42,6 +40,7 @@ There are two different NPM projects at play:
4240
that we want to run inside BrowserPod itself. It's a simple Hello World express.js application.
4341

4442
## 2. Get familiar with the project files
43+
4544
Let's go through the relevant files one by one, explaining their purpose!
4645

4746
### Project's package.json
@@ -234,21 +233,19 @@ await pod.run("node", ["main.js"], {
234233
1. First, boot your Pod as usual and pass a valid Api Key as an argument.
235234
236235
2. Then set up a terminal in the **console** element that was added to the `index.html` file,
237-
so that the output of the commands ran in the Pod are visible.
236+
so that the output of the commands ran in the Pod are visible.
238237
239238
3. Register a callback that will be notified every time an http server is
240-
started inside the Pod. The callback takes a Portal URL as an argument: a randomly generated, publicly accessible URL that you can use to show and interact with the inner project.
239+
started inside the Pod. The callback takes a Portal URL as an argument: a randomly generated, publicly accessible URL that you can use to show and interact with the inner project.
241240
242241
4. It will be shown that the page is up and running and link to it in the `#url` div,
243-
and display a live rendering of it in the `#portal` iframe. Which were both set
244-
up in the `index.html` page.
245-
246-
6. Then copy the project files inside the Pod, using the `copyFile` utility function.
247-
248-
7. Finally, run some commands inside the Pod: `npm install` to install express.js
249-
and its dependencies, and `node main.js` to start the web server.
242+
and display a live rendering of it in the `#portal` iframe. Which were both set
243+
up in the `index.html` page.
250244
245+
5. Then copy the project files inside the Pod, using the `copyFile` utility function.
251246
247+
6. Finally, run some commands inside the Pod: `npm install` to install express.js
248+
and its dependencies, and `node main.js` to start the web server.
252249
253250
## End result
254251

sites/browserpod/src/content/docs/11-explanation/01-api-key.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ An API key is a secret code that lets your app access a BrowserPod API. It ident
88
## Register for an API key
99

1010
1. Register at https://console.browserpod.io
11-
2. Create a key in **Keys & Domains**
11+
2. Create a key in **Keys & Domains**
1212

1313
## Where to store the API key
1414

sites/browserpod/src/content/docs/12-guides/03-hosting.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Set CORS and COOP headers
33
description: Cross-origin isolation for BrowserPod (COOP and COEP)
44
---
5+
56
This guide shows how to configure cross-origin isolation headers for hosting a BrowserPod app, with examples for both Vite (development) and nginx (production) setups.
67

78
BrowserPod requires **cross-origin isolation**, which depends on two headers:
@@ -29,6 +30,7 @@ export default defineConfig({
2930
```
3031

3132
## Production: nginx hosting setup
33+
3234
For production hosting, configure nginx to serve the headers so BrowserPod can run with cross-origin isolation. Create a file named `nginx.conf`:
3335

3436
```nginx

sites/browserpod/src/content/docs/12-guides/04-native-binaries.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ BrowserPod runs Node.js in a Wasm environment. Packages that ship native binarie
1010
If a package has a Wasm-compatible alternative, you can use `overrides` in `package.json` to force npm to install the Wasm version.
1111

1212
### Example: esbuild
13+
1314
To use the Wasm version of `esbuild`:
1415

1516
```json
@@ -19,20 +20,25 @@ To use the Wasm version of `esbuild`:
1920
}
2021
}
2122
```
23+
2224
This forces npm to replace the default `esbuild` package (which contains native binaries) with the Wasm-compatible version.
2325

2426
### Example: rollup
27+
2528
Similarly, for `rollup`:
29+
2630
```json
2731
{
2832
"overrides": {
2933
"rollup": "npm:@rollup/wasm-node@*"
3034
}
3135
}
3236
```
37+
3338
This ensures that the build works inside BrowserPod without relying on native CPU binaries.
3439

3540
## When no Wasm build exists
41+
3642
If a package does not offer a Wasm build, it will not work inside BrowserPod. In that case, you have two options:
3743

3844
1. Look for a different package that offers similar functionality and has a Wasm build.

sites/browserpod/src/content/docs/12-guides/05-common-errors.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,19 @@ This page maps common BrowserPod error messages to their likely causes and fixes
1111

1212
- **Causes**:
1313

14-
- `pod.run` is like `execve` in Linux or `child_process.spawn` in Node.
15-
It does not support shell features like `||` or `&&` or builtins.
14+
- `pod.run` is like `execve` in Linux or `child_process.spawn` in Node.
1615

17-
- Bash support is on the roadmap.
16+
It does not support shell features like `||` or `&&` or builtins.
17+
18+
- Bash support is on the roadmap.
1819

1920
- **Solution**: Write complex behavior as a JavaScript script, and execute that.
2021

2122
## Missing or hidden terminal element
2223

2324
- **Symptoms**:
24-
- `The 'terminal' argument is required`
25-
- Output disappears during long runs
25+
- `The 'terminal' argument is required`
26+
- Output disappears during long runs
2627

2728
- **Cause**: The terminal element was never created or was unmounted.
2829

@@ -34,8 +35,6 @@ const terminal = await pod.createDefaultTerminal(consoleEl);
3435
pod.run(..., {terminal,...});
3536
```
3637

37-
38-
3938
## Using the wrong file mode
4039

4140
- **Symptom**: `Unsupported 'mode' argument`
@@ -51,4 +50,4 @@ pod.run(..., {terminal,...});
5150
- **Cause**: Native binaries do not run in the Wasm environment.
5251

5352
- **Solution**: Use Wasm alternatives and `package.json` overrides. See the
54-
[native binaries guide](/docs/guides/native-binaries).
53+
[native binaries guide](/docs/guides/native-binaries).

sites/browserpod/src/content/docs/13-reference/00-BrowserPod/02-onPortal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ class BrowserPod {
1919
- **port (`number`)** - The local port that is connected to the Portal.
2020

2121
## Returns
22+
2223
`onPortal` does not return a value.

sites/browserpod/src/content/docs/13-reference/01-BinaryFile/02-getSize.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ class BinaryFile {
88
async getSize(): Promise<int>;
99
}
1010
```
11+
1112
## Parameters
13+
1214
`getSize` does not have any parameters.
15+
1316
## Returns
1417

1518
`getSize` returns a [Promise] which is resolved when the operation has succeded.

sites/browserpod/src/content/docs/13-reference/01-BinaryFile/03-close.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ class BinaryFile {
88
async close(): Promise<void>;
99
}
1010
```
11+
1112
## Parameters
13+
1214
`close` does not have any parameters.
1315

1416
## Returns

0 commit comments

Comments
 (0)