Skip to content

Latest commit

 

History

History
52 lines (31 loc) · 1.59 KB

run-local-api.md

File metadata and controls

52 lines (31 loc) · 1.59 KB

Develop with a local API

Backend

To launch the backend, follow the instructions in backend.

In short, if you already set up the repo before:

  • get Docker running
  • run pc start-backend (or restart it if needed)
  • run pc sandbox -n industrial to populate the database

✅ Check: you can access your local swagger

Now back to the frontend.

Frontend

Change the variable API_BASE_URL to http://localhost in .env.testing

Webapp

To launch the web application, run yarn start:web:testing.

Mobile app

To make the mobile app request the backend, you either need to rebuild the application, OR you can change this line:

-   basePath: env.API_BASE_URL,
+   basePath: 'http://localhost',

Make sure your are logged out before changing that. Indeed, the user ids will differ between your backend and the database of testing.

Limitations

Since the backend differs between local / testing, you won't:

  • have the pictures of the offers.
  • be able to access the detail of an offer (wrong id)
  • hence book an offer, or favorite it.

However, you can still access the app and should be able to work around those limitations.

Android - Network request failed

If you run into the error Network request failed when trying to connect an Android device to your backend running locally, run the command:

adb reverse tcp:5001 tcp:5001