TexteaInc / funix

Building web apps without manually creating widgets
http://funix.io
MIT License
89 stars 10 forks source link

Proxy on frontend for requests to backend #60

Closed TURX closed 1 year ago

TURX commented 1 year ago

Some services (e.g., Google App Engine, Heroku) only allow one port to be exposed for a service. In this case, we need to set up a proxy in the entry point under the /api route, for user to access backend through frontend without exposing the backend port.

Here are some links which might be useful:

Yazawazi commented 1 year ago

The frontend and backend share the same port now, no need to worry about naming, just note the function names like static, config and files. static, config are introduced by the frontend service: static resources and backend configuration (use the local frontend to connect to others' backend services); the files is introduced by the backend service: the local file system. I'm considering introducing a decorator parameter that can rename function names to solve that naming problem.

https://github.com/TexteaInc/funix/commit/84920e037d0a877875e77e6e18f418cf8870278d

New: Updated the rename parameter which solves the problem above.