Skip to content

Update development environment connection to Snow Today server #77

@IanSinColorado

Description

@IanSinColorado

Currently, the default way to start this webapp is to create your own local copy of the Snow Today server. In the development docs, we recommend commenting out 3 lines of code to ensure the public Snow Today server is used rather than a localhost. However, asking users to change code to facilitate a development pattern is error-prone, so we should create some way to choose different environments depending on if they have a local Snow Today server or not.

This could be done using webpack to define a "production" mode and "development" mode. In production mode, the default production URL would be used as the API URL, and defined in an envvar that the user could override to point to a different production URL if they prefer. In development mode, it would be calculated as it is now. Or something like that.

https://webpack.js.org/guides/environment-variables/

Additionally, using dotenv-webpack will enable users to override config by editing a file, instead of needing to pass --env ... directly to webpack commands (and necessitating more scripts entries in package.json). compose is capable of reading .env files and passing the envvars into the container so you may not need this webpack extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🔖 Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions