Code Monkey home page Code Monkey logo

criollo's Introduction

Criollo

A powerful Cocoa based web application framework for OS X and iOS.

Version Status Platform Carthage compatible MIT License Twitter

Criollo helps create really fast standalone web apps that deliver content directly over HTTP or FastCGI. You can write code in Objective-C or Swift. And you can use technologies you know and love: Grand Central Dispatch, NSURLSession, CoreImage and many more.

It's as easy as this:

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

and in Swift:

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

Why?

Criollo was created in order to take advantage of the truly awesome tools and APIs that OS X and iOS provide and serve content produced with them over the web.

It incorporates an HTTP web server and a FastCGI application server that are used to deliver content. The server is built on Grand Central Dispatch and designed for speed.

How to Use

Criollo can easily be embedded as a web-server inside your OS X or iOS app, should you be in need of such a feature, however it was designed to create standalone, long-lived daemon style apps. It is fully launchd compatible and replicates the lifecycle and behaviour of NSApplication, so that the learning curve should be as smooth as possible.

See the Hello World Multi Target example for a demo of the two usage patterns.

Getting Started

Installing

The preferred way of installing Criollo is through CocoaPods. However, you can also embed the framework in your projects manually.

Installing with 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

Please note that Criollo will download CocoaAsyncSocket as a dependency.

Cloning the repo

Criollo uses CocoaAsyncSocket which is included as a git submodule

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

Work in Progress

Criollo is work in progress and - as such - it’s not ready for the wild yet. The reason for this is mainly missing functionality and sheer lack of documentation[^It is also very high on my list of priorities, but sadly still a “to-do” item].

The existing APIs are relatively stable and are unlikely to change dramatically unless marked as such.

Missing Biggies

  1. Multipart request body parsing. Criollo can handle JSON and URL-encoded bodies for now. Upcoming and in progress is the multipart/form-data request parsing.
  2. Binary / MIME body. Requests that send binary data completely ignore this for now. This implementation is on the way, right after multipart.
  3. HTTPS - The workaround for this is putting your app behind a web server, like Nginx, and using the web-server as a reverse HTTP proxy or FastCGI client. Here’s an example of how to setup nginx to reverse proxy HTTP requests and here’s how to set up FastCGI.

Get in Touch

If you have any questions regarding the project or how to do anything with it, please feel free to get in touch either on Twitter @criolloio or by plain old email [email protected].

I really encourage you to submit an issue, as your input is really and truly appreciated.

criollo's People

Contributors

myrup avatar thecatalinstan avatar

Watchers

 avatar  avatar

Forkers

vladneste

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.