简体   繁体   中英

Which laravel routes to use for an IOS app services (web routes or API routes )

I am working on a project in which I have to provide services to a mobile app. Services like sign up, login etc.

I was studying Laravel 5.3 routes. There are two main types of routes: web routes and API routes . I read about these but I am still confused about my situation.

I am new to Laravel so my question is which facility is better in my situation.

And any advice on providing services for mobile app will be helpful.

My advise to you would be to use Laravel as an API service and create all your routes in API

from your iOS app you would then send requests to your Laravel server via the /api routes and perform the necessary logic

this way all your logic resides on your Laravel server which means you can make your iOS app as dumb as possible, being only responsible for showing something visual, and communicating with your server for any information it requires

if you don't need all the features of Laravel to do this i would recommend using the Lumen framework, which is a stripped down version of laravel made for API work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM