Skip to content
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

Emulate routes config #6

Closed
manekinekko opened this issue Jul 30, 2020 · 4 comments · Fixed by #86
Closed

Emulate routes config #6

manekinekko opened this issue Jul 30, 2020 · 4 comments · Fixed by #86
Assignees
Labels
priority: medium (P1) Medium priority scope: core Issues happened a the ./src/core level type: enhancement New feature or request
Projects

Comments

@manekinekko
Copy link
Member

manekinekko commented Jul 30, 2020

Checkout docs for more details.

@manekinekko manekinekko added type: enhancement New feature or request priority: medium (P1) Medium priority scope: core Issues happened a the ./src/core level labels Jul 30, 2020
@aaronpowell
Copy link
Contributor

With #11 I've implemented a first-pass on supporting this.

When the proxy starts up it'll look for a routes.json file in the app_artifact_location, and if it exists it'll load those routing rules into the proxy server. Then, when a request comes in, the proxy server will check if the route matches a rule. If a rule is found, the app which check what the rule states (access control, redirect or status code response), and then apply what the rule states.

@aaronpowell
Copy link
Contributor

There's still a few outstanding things:

@anthonychu
Copy link
Member

With the new unified config file coming, perhaps we should pivot and support that instead of routes.json.

Also would be great if the emulator can search for the config file, starting from the app_location. Perhaps add an additional command line flag to specify the location of the file, as this info may not be available when starting using something like --use-app.

@mkarmark can provide info on the routing, fallback, and response overrides logic in the new config file.

@manekinekko
Copy link
Member Author

manekinekko commented Jan 20, 2021

Notes from today's meeting with Anthony Chu and Mitali Karmarkar:

  • idea: we could publish the route engine as a binary and do a function call from within the CLI.

@manekinekko manekinekko pinned this issue Jan 20, 2021
@manekinekko manekinekko mentioned this issue Jan 20, 2021
manekinekko added a commit that referenced this issue Feb 17, 2021
manekinekko added a commit that referenced this issue Feb 26, 2021
@manekinekko manekinekko added this to To do in Pre-GA via automation Feb 27, 2021
@manekinekko manekinekko moved this from To do to In progress in Pre-GA Feb 27, 2021
@manekinekko manekinekko self-assigned this Feb 27, 2021
manekinekko added a commit that referenced this issue Mar 5, 2021
Pre-GA automation moved this from In progress to Done Mar 5, 2021
manekinekko added a commit that referenced this issue Mar 5, 2021
@manekinekko manekinekko unpinned this issue Mar 9, 2021
vivekjilla pushed a commit that referenced this issue Mar 1, 2023
* feat: add 'swa db init' command

* added support for custom folder names, adjusted template for schema file, adjusted usage of cosmosdb params to fix bug

* Using execFileCommand instead of execSync to prevent shell injection attacks in case of untrusted user input

* merge: get latest changes

* fix: added cosmosdb_postgresql and refactored

* chore: nit comments

* fix: more checks to handle corner cases

* fix: add validDBcheck

* fix: nit comments

* Changed rest path in db init to /rest and fixed bug causing error to throw when valid database type is passed

---------

Co-authored-by: sgollapudi77 <85578033+sgollapudi77@users.noreply.github.com>
sgollapudi77 added a commit that referenced this issue Mar 14, 2023
* feat: Initial changes to download dab binary

* feat: add "data-api-location" flag support for 'swa start'

* feat: proxy requests made to "/data-api" to dab-cli

* fix: unzipping of DAB-package and routing issue

* nit: nit comments

* feat: add support for "staticwebapp.db.config.json" and nit changes

* chore: nit changes and handling staticwebapp.database.config.json

* chore: nit comments

* fix: temp url for data-api binary download
fix: authentication headers in dab routing
fix: swa start --help

* feat: add separate executable based on the OS and nit changes

* fix: ERR_STREAM_WRITE_AFTER_END error while writing stream

* nit: resolve comments

* fix: rename dab binary to new binary Name

* fix: Linux permission issue for dab-executable

* fix: fix naming while running dab command

* nit: resolve comments

* Added swa db init command (#6)

* feat: add 'swa db init' command

* added support for custom folder names, adjusted template for schema file, adjusted usage of cosmosdb params to fix bug

* Using execFileCommand instead of execSync to prevent shell injection attacks in case of untrusted user input

* merge: get latest changes

* fix: added cosmosdb_postgresql and refactored

* chore: nit comments

* fix: more checks to handle corner cases

* fix: add validDBcheck

* fix: nit comments

* Changed rest path in db init to /rest and fixed bug causing error to throw when valid database type is passed

---------

Co-authored-by: sgollapudi77 <85578033+sgollapudi77@users.noreply.github.com>

* updating register command changes for dab

* build error

* reverting few package-lock changes

* move registerdb out to keep it consistent with others

* refactor: moved dab init files to subfolder to accommodate dab add, dab update commands later

* nit: addressing comments from older PR

* fix: add support for downloading latest tag/specific version

* fix: comment pinned version code

* nit: triggering new build

---------

Co-authored-by: sgollapudi77 <85578033+sgollapudi77@users.noreply.github.com>
Co-authored-by: Sai Vamsi Krishna Gollapudi <sgollapudi@microsoft.com>
Co-authored-by: Thomas Gauvin <35609369+thomasgauvin@users.noreply.github.com>
sgollapudi77 added a commit that referenced this issue Mar 16, 2023
commit 2edf444
Author: sgollapudi77 <85578033+sgollapudi77@users.noreply.github.com>
Date:   Wed Mar 15 11:05:09 2023 +0530

    chore: bump into 1.1.1-alpha after release (#668)

commit c242066
Author: sgollapudi77 <85578033+sgollapudi77@users.noreply.github.com>
Date:   Tue Mar 14 17:51:20 2023 +0530

    chore: prep-release 1.1.0 (#667)

commit a77bd50
Author: Vivek Jilla <vivekjilla7@gmail.com>
Date:   Tue Mar 14 13:09:17 2023 +0530

    feat: dab integration (#662)

    * feat: Initial changes to download dab binary

    * feat: add "data-api-location" flag support for 'swa start'

    * feat: proxy requests made to "/data-api" to dab-cli

    * fix: unzipping of DAB-package and routing issue

    * nit: nit comments

    * feat: add support for "staticwebapp.db.config.json" and nit changes

    * chore: nit changes and handling staticwebapp.database.config.json

    * chore: nit comments

    * fix: temp url for data-api binary download
    fix: authentication headers in dab routing
    fix: swa start --help

    * feat: add separate executable based on the OS and nit changes

    * fix: ERR_STREAM_WRITE_AFTER_END error while writing stream

    * nit: resolve comments

    * fix: rename dab binary to new binary Name

    * fix: Linux permission issue for dab-executable

    * fix: fix naming while running dab command

    * nit: resolve comments

    * Added swa db init command (#6)

    * feat: add 'swa db init' command

    * added support for custom folder names, adjusted template for schema file, adjusted usage of cosmosdb params to fix bug

    * Using execFileCommand instead of execSync to prevent shell injection attacks in case of untrusted user input

    * merge: get latest changes

    * fix: added cosmosdb_postgresql and refactored

    * chore: nit comments

    * fix: more checks to handle corner cases

    * fix: add validDBcheck

    * fix: nit comments

    * Changed rest path in db init to /rest and fixed bug causing error to throw when valid database type is passed

    ---------

    Co-authored-by: sgollapudi77 <85578033+sgollapudi77@users.noreply.github.com>

    * updating register command changes for dab

    * build error

    * reverting few package-lock changes

    * move registerdb out to keep it consistent with others

    * refactor: moved dab init files to subfolder to accommodate dab add, dab update commands later

    * nit: addressing comments from older PR

    * fix: add support for downloading latest tag/specific version

    * fix: comment pinned version code

    * nit: triggering new build

    ---------

    Co-authored-by: sgollapudi77 <85578033+sgollapudi77@users.noreply.github.com>
    Co-authored-by: Sai Vamsi Krishna Gollapudi <sgollapudi@microsoft.com>
    Co-authored-by: Thomas Gauvin <35609369+thomasgauvin@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium (P1) Medium priority scope: core Issues happened a the ./src/core level type: enhancement New feature or request
Projects
No open projects
Pre-GA
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants