npm install- Create the file
.env.localin 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/apiYor 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 filein the Mockoon app. - Import the
mockoon.jsonfile from project's directory. - Start the server by clicking the play button.
- Create the
.env.localfile in the root of the project. - Add
APP_API_URL=http://localhost:3001/apito this file.
Use npm run start to build and serve the example application.