In a JavaScript app, what do you call a file that only contains functions...


In a JavaScript app, what do you call a file that only contains functions that perform HTTP requests?

For example, this file contains functions that request user data.

(Poll in followup tweet)

#javascript

What would you name a file that just contains functions that make HTTP requests for user data?
Insights in this thread:

Tip 1: Top terms in order of popularity:
service
api
client
repository
adapter
controller
middleware
gateway

Tip 2: Separate plain api functions from service logic. Example: userApi is just fetch calls. userService has richer services and calls userApi.

View original on X