-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Description
Run bun server.js with these 2 files in a folder:
server.js:
import home from './index.html'
let server = Bun.serve({ routes: { '/': home } })
console.log(`Server at ${server.url}`)index.html:
<!doctype html>
<title>Hi</title>
hello world... and the server is accessible on both localhost and over the network by IP address.
But run bun index.html and the server is only accessible on localhost.
Shouldn't bun index.html automatically be exposed over the network as per if running a .js file? This behaviour seems inconsistent if not.
Workaround: bun index.html --host=:3000 works, but annoying to have to add --host=:3000 when you don't need that for bun server.js.
Metadata
Metadata
Assignees
Labels
No labels