#Serving static files with Bun serve

1 messages · Page 1 of 1 (latest)

fleet moss
#

I'm running the command below to serve a static HTML site:

bun index.html ./**/*

Here's a simplified tree view:

.
├── data
│   └── projects.json
├── index.html
├── package.json
├── projects
│   ├── index.html
│   └── script.js

When I try going to localhost:3000/data/projects.json, I get a Not Found error. How can I fix this?

fleet moss
#

Serving static files with Bun serve

cunning walrus
#

the easiest way to get other files is to do the Bun.serve yourself and import html/other static assets