All-Inclusive-Web-Team / forum-project

The landing page of AIWT.
GNU General Public License v3.0
3 stars 8 forks source link

Move all server calls to a behind a proxy? #19

Closed monocle closed 1 year ago

monocle commented 1 year ago

It might be helpful for development if a new team member could work on the front end code without having to deal with the back end. If the front end used a proxy to interface with server calls instead of calling axios directly, then a mock server could be used during development.

An added benefit would be that the front end could be run in a demo mode that would not require a back end at all. Demo mode could be deployed for usability testing without the need for login management or other server requirements.

adamwhitlock1 commented 1 year ago

A proxy meaning what? If you want to deploy a dev server to serve requests then I guess that could work. Similarly I would pin down a 'contract' for the FE and BE on what endpoints return what data, and create a mock api via MSW or a similar library, so that you still do requests via axios or fetch and MSW intercepts the call.

monocle commented 1 year ago

A proxy meaning what? If you want to deploy a dev server to serve requests then I guess that could work.

No, not a dev server. We'd be going for removing any need for a back end server for the majority of front end development.

Similarly I would pin down a 'contract' for the FE and BE on what endpoints return what data, and create a mock api via MSW or a similar library, so that you still do requests via axios or fetch and MSW intercepts the call.

Yup, this exactly. I haven't used MSW, but it looks like a great option.

ddowy commented 1 year ago

@adamwhitlock1 Thank you for bringing up MSW, I have not heard of it before but it sounds like exactly what we need. I was going to say we could just implement something like sql lite so the data just lives on the server, but this is even better. I am going to do some research into it. Also if you could, could you elaborate on these endpoint contracts?

ddowy commented 1 year ago

I am going to close this issue because I opened another one called implementing MSW or mock api