Criollo是一款基于Cocoa的Web框架,用于OSX和iOS系统。
Cocoa有助于创建非常快速独立的web应用程序,这些程序直接通过HTTP或FastCGI提供内容。你可以用Objective-C或者Swift语言编写代码。同时你也可以用你自己知道或者喜欢的:GrandCentralDispatch,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 inresponse.send("Hello world!")}, forPath: "/")server.startListening()入门
DownloadCriolloandtryouttheincludedOSXandiOSexampleapps.CriollorequiresCocoaAsyncSocket,sodonotforgettodownloaditintoLibraries/CocoaAsyncSocket.
Readthe“GettingStarted”guideandmovefurtherwiththe“DoingMoreStuff”guide
CheckoutthedocumentationforalookattheAPIsavailable
LearnhowtodeployyourCriolloappsinthe“Deployment”guide
安装
安装CocoaPods
CreatethePodfileifyoudon’talreadyhaveone.Youcandosobyrunningpodinitinthefolderoftheproject.
AddCriollotoyourPodfile.pod'Criollo','~>0.1’
Runpodinstall
复制repo
git clone --recursive https://github.com/thecatalinstan/Criollo.git
评论