Node.js Adapter (@react-just/node
)
Plugin Usage
ts
import node from "@react-just/node";
import react from "react-just/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [react(), node()],
});
CLI Usage
The Node.js adapter provides a CLI command to serve your React Just app.
bash
$ npx react-just-node [build] -p [port] [--no-static]
bash
$ pnpm react-just-node [build] -p [port] [--no-static]
bash
$ bun react-just-node [build] -p [port] [--no-static]
Parameters
build
(optional): Path to the build output folder. Defaults todist
.-p
or--port
(optional): Port to run the server on. Defaults to3000
.--no-static
(optional): Disables serving static files from thestatic
directory.
Examples
Serve a custom build folder output
on port 4000
:
bash
$ npx react-just-node output -p 4000
bash
$ pnpm react-just-node output -p 4000
bash
$ bun react-just-node output -p 4000
Run without serving static files:
bash
$ npx react-just-node --no-static
bash
$ pnpm react-just-node --no-static
bash
$ bun react-just-node --no-static