Node.js Server
Brisa enables starting as a Node.js Server to serve your app by changing the output
to node
. It generates a Node.js server that serves your application on the port 3000 by default, it can be changed with the flag --port
.
This server is capable of serving your application with all the features that Brisa offers, such as i18n, routing, server actions and middleware.
You need a different
output
type thanbun
since during the build your application is optimized to be served on a Node.js server.
Configuration (Optional)
To enable a web service application, change the output mode inside brisa.config.ts
:
import type { Configuration } from "brisa";
export default {
output: "node",
} satisfies Configuration;
After running brisa build
, Brisa will generate a Node.js server that serves your application on the port 3000 by default.
Changing the port
To change the port, you can use the flag --port
:
brisa start --port 8080
The default port is
process.env.PORT
or3000
.
After running brisa build
, Brisa will generate a Bun server that serves your application on the port 8080.
Although you can still use the Bun tooling to start your application in Node.js, if you want, you can use
NODE_ENV=production node build/server.js
to start your application with Node.js without Brisa CLI.
Custom server
If you want to use a custom server, you can follow this guide: Custom Server.