rest - Why do API's have different URLs? -


why api's use different urls? there 2 different interfaces on web server? 1 processing api requests , other web http requests? example there might site called www.joecoffee.com use url www.api.joecoffe.com api requests. why different urls being used here?

we separate ours couple of reasons, , won't apply.

separation of concerns.

we write api code in 1 project, , deploy in 1 unit. when work on api worry , don't worry page layout. when web work, that's separate

different authentication mechanisms.

the way tell user log in quite different how tell api client it's not authenticated.

different scalability requirements

it might api lot of complex operations, while web-server serves more or less static content. might want add hundreds of api servers around world, have 10 web servers.

different clients

you might have api web client , separate api mobile client. or perhaps public 1 , private / authenticated one. might not apply example.

different technologies

kind of extension of separation of concerns, allows have linux server 1 , use aws lambda other.

ssl wrangling

this 1 more of anti-reason (particularly specific example give). many sites use ssl both web , api. sites going use ssl api @ least. tend have ssl certificates matched url, there might reason there. said, if had *.joecoffee.com certificate use api.joecoffee.com not www.api.joecoffee.com (because apparently '.' in url costs more, or that).

as @james suggested - there's no right answer , debate.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -