npm install
- Create the file
.env.local
in the root of the project. - Add the key
APP_API_URL
- Let key point to a local or remote mock API server.
Example:
APP_API_URL=https://loremipsum.x.pipedream.net/api
Yor mock API server must provide an /users
endpoint.
You can use Mockoon to provide such mock API, for example.
- Download and install the app.
- Select
Tools > Import all environments from file
in the Mockoon app. - Import the
mockoon.json
file from project's directory. - Start the server by clicking the play button.
- Create the
.env.local
file in the root of the project. - Add
APP_API_URL=http://localhost:3001/api
to this file.
Use npm run start
to build and serve the example application.