diff options
Diffstat (limited to 'docs/cli/bun-dev.md')
-rw-r--r-- | docs/cli/bun-dev.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/cli/bun-dev.md b/docs/cli/bun-dev.md new file mode 100644 index 000000000..5d1adec5f --- /dev/null +++ b/docs/cli/bun-dev.md @@ -0,0 +1,21 @@ +In your project folder root (where `package.json` is): + +```bash +$ bun bun ./entry-point-1.js ./entry-point-2.jsx +$ bun dev +``` + +By default, `bun dev` will look for any HTML files in the `public` directory and serve that. For browsers navigating to the page, the `.html` file extension is optional in the URL, and `index.html` will automatically rewrite for the directory. + +Here are examples of routing from `public/` and how they’re matched: +| Dev Server URL | File Path | +|----------------|-----------| +| /dir | public/dir/index.html | +| / | public/index.html | +| /index | public/index.html | +| /hi | public/hi.html | +| /file | public/file.html | +| /font/Inter.woff2 | public/font/Inter.woff2 | +| /hello | public/index.html | + +If `public/index.html` exists, it becomes the default page instead of a 404 page, unless that pathname has a file extension. |