V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
mhtt
V2EX  ›  iDev

服务器端 API,大家都是怎么架构的呢?

  •  
  •   mhtt · Jul 25, 2014 · 12361 views
    This topic created in 4294 days ago, the information mentioned may be changed or developed.
    我们接客户的app单子,也会做自己的app,在服务器端我们用了可能是大家眼里最初级,但容易上手的php+mysql,restful框架基于github上的一个开源框架CodeIgniter Rest Server(https://github.com/chriskacerguis/codeigniter-restserver),做了自己的改造。 你们的是个什么样的情况呢?
    ps. 听说node.js在对app强劲的支持表现很久了,有推荐的restful框架吗?
    Supplement 1  ·  Jul 25, 2014
    大家别光收藏,也来分享分享你的
    29 replies    2014-07-25 18:38:15 +08:00
    dofaith09
        1
    dofaith09  
       Jul 25, 2014   ❤️ 1
    php slim framework 可以试试, 轻量级, benchmark测试效率挺高的.这里有个guide:

    http://www.androidhive.info/2014/01/how-to-create-rest-api-for-android-app-using-php-slim-and-mysql-day-12-2/

    这个是用Go写的 https://github.com/ant0ine/go-json-rest
    spark
        2
    spark  
       Jul 25, 2014 via iPhone
    Sails
    pobing
        3
    pobing  
       Jul 25, 2014
    mhtt
        4
    mhtt  
    OP
       Jul 25, 2014
    @zyx89513 感谢已发
    dopcn
        5
    dopcn  
       Jul 25, 2014
    rails 可以用来做 API 吗
    CoX
        6
    CoX  
       Jul 25, 2014
    Slim 做 Rest API 很不错
    jjzxcc
        7
    jjzxcc  
       Jul 25, 2014
    @dopcn 可以啊,我正在用rails + grape。
    justfindu
        8
    justfindu  
       Jul 25, 2014
    我之前也用楼主同样的方式做接口, 不过最终没有推出. 想问下压力如何.
    wecoders
        9
    wecoders  
       Jul 25, 2014
    用你熟悉的方案,php,python,ruby,go,java都可以
    我直接python+tornado
    simonyan
        10
    simonyan  
       Jul 25, 2014
    node + express,搭建的很快。
    yakczh
        11
    yakczh  
       Jul 25, 2014
    wangfeng3769
        12
    wangfeng3769  
       Jul 25, 2014
    @wecoders
    赞同不过python flask 更轻量级
    yueyoum
        13
    yueyoum  
       Jul 25, 2014
    我一直没明白, REST API 一定要用 REST 框架来做吗?

    有个自己熟悉的 web 框架, 定义好 URL, 各种 HTTP METHOD 的相应,
    不就完成了这项工作吗?
    humiaozuzu
        14
    humiaozuzu  
       Jul 25, 2014
    公司用的是 Flask,自己写几个 helper function 就 REST 了。
    rming
        15
    rming  
       Jul 25, 2014
    根据需求选工具啊,如果单纯做api自己用,那你说的那个框架里的Format class岂不是没什么用
    TangMonk
        16
    TangMonk  
       Jul 25, 2014
    @yueyoum 麻烦啊,
    mahone3297
        17
    mahone3297  
       Jul 25, 2014
    @TangMonk 这么说restful框架帮忙做了很多事?
    TangMonk
        18
    TangMonk  
       Jul 25, 2014
    @mahone3297 是啊,你自己用纯PHP 和用 slim 框架对比下就知道了呗,能省很多事
    TangMonk
        19
    TangMonk  
       Jul 25, 2014
    @mahone3297 况且这种轻量框架又是一眼就看懂的,又不难学
    sxd
        20
    sxd  
       Jul 25, 2014
    format
        21
    format  
       Jul 25, 2014
    http://www.ruanyifeng.com/blog/2014/05/restful_api.html
    ruanyifeng老师有篇文章讲RESTFUL API设计的,可以参考。
    robertlyc
        22
    robertlyc  
       Jul 25, 2014
    ruby的grape
    liunan1321
        23
    liunan1321  
       Jul 25, 2014
    beego
    mahone3297
        24
    mahone3297  
       Jul 25, 2014
    @TangMonk 那我如果用大型框架呢?比如zend,symfony,laravel这种?跟什么resuful框架比有什么区别?
    TangMonk
        25
    TangMonk  
       Jul 25, 2014
    @mahone3297 restful 框架要轻量些,拿到就可以用,MVC里就只有 C 层
    TangMonk
        26
    TangMonk  
       Jul 25, 2014
    @mahone3297 我没用过 slim,不过粗略看了下官网,应该和我想的一样。
    awebird
        27
    awebird  
       Jul 25, 2014
    也是用的codeigniter-restserver,还算方便,我觉得oauth, cahce和DB的优化这些经典问题比用什么框架还重要些
    mhtt
        28
    mhtt  
    OP
       Jul 25, 2014
    @justfindu 目前没有遇到压力问题。
    @awebird thanks
    garth
        29
    garth  
       Jul 25, 2014
    最简单的API Server: https://github.com/easychen/LazyREST
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3888 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 70ms · UTC 00:09 · PVG 08:09 · LAX 17:09 · JFK 20:09
    ♥ Do have faith in what you're doing.