0

which one is best to implement Rest API for mobile app And Web client using nodejs?

1. Different API used for mobile and web

Mobile App API:

/api/v1/mobile/userLogin

Web Client API:

/api/v1/mobile/userLogin

2.Same API for Mobile & Web /api/v1/userLogin

This is my API concept any one give suggestion or information to help with us!

Both api or same functionality but different our platform i.e(mobile & web)

which one is used to better 1st or 2nd ?

1 Answers1

0

The best way is to combine both concepts, but under the hood:

/api/mobile/v1
/api/web/v1

In your code there could be same services.

Anyway you will struggle against mobile application versioning. But for web it is not so certain.

Second aspect is authorization mechanism. Usually it differs for web and mobile.

Checkout a good one topic about URLs, versions, The Universe, and Everything. Best practices for API versioning?

Community
  • 1
  • 1
Ostin
  • 1,511
  • 1
  • 12
  • 25