Skip to content

Allow to configure iot-api's url #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 17, 2022
Merged

Conversation

glumia
Copy link
Contributor

@glumia glumia commented Nov 12, 2021

Motivation

At the moment the only way we have to bind the CLI to our development environment is by modifying the source code and recompiling the binary.

This is painful as during development one needs to quickly switch between local/dev/prod environments depending on what he needs to test.

Change description

  • Allow to configure iot-api's base url through a IOT_API_URL environment variable (fallback to production's api2.arduino.cc if not set).

Reviewer checklist

  • PR address a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • History is clean, commit messages are meaningful (see CONTRIBUTING.md) and are well formatted.

@glumia glumia changed the title Allow to configure dev iot-api at runtime Allow to configure iot-api's url Nov 12, 2021
@glumia glumia requested a review from polldo November 12, 2021 12:19
@glumia glumia force-pushed the glumia/bind-to-dev-environment branch from ebe66de to 5504100 Compare November 12, 2021 12:22
@polldo polldo force-pushed the glumia/bind-to-dev-environment branch from 5504100 to 81748a7 Compare August 17, 2022 09:11
Copy link
Contributor

@polldo polldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased and adapted

An alternative approach is to add the base url as an optional parameter of the configuration, like we did in https://github.com/arduino/arduino-cloud-cli/pull/105/files . This would allow consumers of the command package to change the url programmatically. It would also allow to have a config file for dev environment.

Let's merge this, we can switch to the alternative in the future if needed.

@polldo polldo merged commit 7feb9d8 into main Aug 17, 2022
@polldo polldo deleted the glumia/bind-to-dev-environment branch August 17, 2022 10:30
polldo pushed a commit that referenced this pull request Sep 2, 2022
* Update config file name

* Allow to configure iot-api's url
polldo pushed a commit that referenced this pull request Sep 2, 2022
* Update config file name

* Allow to configure iot-api's url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants