Bun Middleware
Qwik City Bun middleware allows you to hook up Qwik City to a Bun server which uses the Bun Http API.
Installation
To install bun on Linux, OSX or WSL run the following command in your terminal
curl -fsSL https://bun.sh/install | bash For other platforms or if you run into issues with installation, up to date bun installation instructions can be found on the bun website.
If you run into the error Something went wrong installing the "sharp" module when using bun as a package manager, add the following code to your package.json, then remove the node_modules folder and any lockfiles such as bun.lockb or package-lock.json. Then run bun install.
"trustedDependencies": [
"sharp"
]This issue is currently being tracked on the bun repository.
To integrate the bun adapter, use the add command:
- For the integrated HTTP server:
bun run qwik add bunProduction build
To build the application for production, use the build command, this command will automatically run bun run build.server and bun run build.client:
bun run buildServe
To start the Bun server after a build:
bun run serveProduction deploy
Since you are choosing Bun, here you are in your own, after running bun run build:
- The
distfolder will be created including all the static files. - The
serverfolder will be created including all bun server files.