DEV Community

Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

What is the best way for frontend to communicate with database, when in development?

I actually mean,

  • Minimally create a backend
  • Expose overly powerful / dangerous API endpoints in development
  • Move functions from frontend to backend
  • Drop potentially dangerous API endpoints in production

Top comments (2)

Collapse
 
michaelphipps profile image
Phippsy
  • Mock your API calls so you don't need to create or expose dangerous API endpoints.
  • When your front end is ready, create the actual secure back end API in your development environment.
  • Push your production ready code live.
  • Don't do any coding work in production environments.

Search "mocking API calls in [front end]". I see there are lots of good results for Vue.

Collapse
 
desbest profile image
Adisa Nicholson

Not all websites require an API, but if you need one you have to make one. Also your question is vague.