GeriLife / wellbeing-client

Client-only code for Wellbeing project.
Apache License 2.0
0 stars 0 forks source link

Development proxy #36

Closed brylie closed 3 years ago

brylie commented 3 years ago

Add a proxy configuration, so the development environment matches deployment. This configuration will proxy any requests starting with /api to the GeriLife server running at port 3000 (Meteor default port), so we can hopefully do without any Docker configuration to run our client/server on the same development computer.

https://quasar.dev/quasar-cli/api-proxying

brylie commented 3 years ago

@shailee-m please test and review this pull request before troubleshooting the static build.

shailee-m commented 3 years ago

@brylie The proxy is not working locally for service files.

brylie commented 3 years ago

Are you getting a specific error? What port is the Meteor app running on locally? What would need to be changed to get the proxy working locally?

brylie commented 3 years ago

@shailee-m this proxy configuration is working for me when I use a REST client

image

However, I am getting an error in the Vue app, along with the form submitting:

[HPM] Error occurred while trying to proxy request /users/login?_t=1617977679163 from localhost:8080 to http://localhost:3000 (ECONNRESET) (https://nodejs.org/api/errors.html#errors_common_system_errors)

Can you please help me to get this pull request working?

brylie commented 3 years ago

Using the development proxy is the way to go here since it is officially documented by Quasar and seems common in SPA development. Using the proxy approach is also supported in the Dokku deployment, which would align our deployment and development environments without any complicated configuration.