×

Criollo基于Cocoa的Web框架

消耗积分:0 | 格式:zip | 大小:0.44 MB | 2022-06-27

张磊

分享资料个

授权协议 MIT
开发语言 Objective-C Swift
操作系统 OS X
软件类型 开源软件
所属分类 Web应用开发Web框架

软件简介

 

Criollo 是一款基于 Cocoa 的 Web 框架,用于 OS X 和 iOS 系统。

Cocoa有助于创建非常快速独立的web应用程序,这些程序直接通过HTTP或FastCGI提供内容。你可以用Objective-C 或者 Swift语言编写代码。同时你也可以用你自己知道或者喜欢的:Grand Central Dispatch, NSURLSession, CoreImage 甚至更多。

就像这样很容易:

CRServer* server = [[CRHTTPServer alloc] init];
[server addBlock:^(CRRequest * request, CRResponse * response, CRRouteCompletionBlock completionHandler) {
[response send:@"Hello world!"];
} forPath:@"/"];
[server startListening];

用Swift

let server:CRServer = CRHTTPServer()
server.addBlock({ (request, response, completionHandler) -> Void in
response.send("Hello world!")
}, forPath: "/")
server.startListening()

入门

安装

安装CocoaPods

  1. Create the Podfile if you don’t already have one. You can do so by running pod init in the folder of the project.

  2. Add Criollo to your Podfile. pod 'Criollo', '~> 0.1’

  3. Run pod install

复制repo

git clone --recursive https://github.com/thecatalinstan/Criollo.git
 

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !