Node.js and a package manager (npm, yarn, pnpm, or bun) installed. Choose one of the following commands based on your preferred package manager:
npm install
# or
yarn install
# or
pnpm install
# or
bun install
Open a separate terminal window.
Run the following command:
npx json-server db.json
This will typically start the server on port 3000 (http://localhost:3000).
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Create a file named .env.local at the root of your project.
Add the following line, replacing the placeholder with the actual URL of your fake server:
Now your application should be able to interact with the fake server
All fake server data will be stored in db.json found in the root of the directory