Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ZewoGraveyard/Aeon
[Deprecated]
https://github.com/ZewoGraveyard/Aeon
Last synced: 3 months ago
JSON representation
[Deprecated]
- Host: GitHub
- URL: https://github.com/ZewoGraveyard/Aeon
- Owner: ZewoGraveyard
- License: mit
- Created: 2015-11-05T03:19:45.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-18T05:31:29.000Z (over 8 years ago)
- Last Synced: 2024-05-16T07:42:12.821Z (8 months ago)
- Language: Swift
- Homepage:
- Size: 134 KB
- Stars: 63
- Watchers: 7
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-swift-cn - Aeon - GCD based HTTP server for Swift 2. (Libs / Network)
README
[Deprecated] Aeon
====[![Swift 2.1](https://img.shields.io/badge/Swift-2.1-orange.svg?style=flat)](https://developer.apple.com/swift/)
[![Platforms OS X | iOS](https://img.shields.io/badge/Platforms-OS%20X%20%7C%20iOS-lightgray.svg?style=flat)](https://developer.apple.com/swift/)
[![CocoaPods Compatible](https://img.shields.io/badge/CocoaPods-Compatible-4BC51D.svg?style=flat)](https://cocoapods.org/pods/Luminescence)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-Compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](https://tldrlegal.com/license/mit-license)
[![Slack Status](https://zewo-slackin.herokuapp.com/badge.svg)](https://zewo-slackin.herokuapp.com)**Aeon** is a GCD based HTTP server for **Swift 2**.
## Features
- [x] No `Foundation` dependency (**Linux ready**)
## Dependencies
**Aeon** is made of:
- [TCPIP](https://github.com/Zewo/TCPIP) - TCP/IP
- [GrandCentralDispatch](https://github.com/Zewo/GrandCentralDispatch) - GCD wrapper
- [URI](https://github.com/Zewo/URI) - URI
- [HTTP](https://github.com/Zewo/HTTP) - HTTP request/response
- [HTTPParser](https://github.com/Zewo/HTTPParser) - HTTP parser## Related Projects
- [HTTPRouter](https://github.com/Zewo/Router) - HTTP router
- [HTTPMiddleware](https://github.com/Zewo/Middleware) - HTTP middleware framework## Usage
### Solo
You can use **Aeon** without any extra dependencies if you wish.
```swift
import HTTP
import Aeonstruct HTTPServerResponder: HTTPResponderType {
func respond(request: HTTPRequest) -> HTTPResponse {
// do something based on the HTTPRequestreturn HTTPResponse(status: .OK)
}
}let responder = HTTPServerResponder()
let server = HTTPServer(port: 8080, responder: responder)
server.start()
```### Aeon + HTTPRouter
You'll probably need an HTTP router to make thinks easier. **Aeon** and [HTTPRouter](https://github.com/Zewo/Router) were designed to work with each other seamlessly.
```swift
import HTTP
import HTTPRouter
import Aeonlet router = HTTPRouter { router in
router.post("/users") { request in
// do something based on the HTTPRequest
return HTTPResponse(status: .Created)
}router.get("/users/:id") { request in
let id = request.parameters["id"]
// do something based on the HTTPRequest and id
return HTTPResponse(status: .OK)
}
}let server = HTTPServer(port: 8080, responder: router)
server.start()
```## Installation
### CocoaPods
[CocoaPods](https://cocoapods.org/) is a dependency manager for Cocoa projects. You can install it with the following command:
```bash
$ gem install cocoapods
```> CocoaPods 0.39.0+ is required to build Aeon.
To integrate **Aeon** into your Xcode project using CocoaPods, specify it in your `Podfile`:
```ruby
source 'https://github.com/Zewo/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!pod 'Aeon', '0.3'
```
> Don't forget `source 'https://github.com/Zewo/Specs.git'`. This is very important. It should always come before the official CocoaPods repo.Then, run the following command:
```bash
$ pod install
```### Carthage
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.
You can install Carthage with [Homebrew](http://brew.sh/) using the following command:
```bash
$ brew update
$ brew install carthage
```To integrate **Aeon** into your Xcode project using Carthage, specify it in your `Cartfile`:
```ogdl
github "Zewo/Aeon" == 0.3
```### Command Line Application
To use **Aeon** in a command line application:
- Install the [Swift Command Line Application](https://github.com/Zewo/Swift-Command-Line-Application-Template) Xcode template
- Follow [Cocoa Pods](#cocoapods) or [Carthage](#carthage) instructions.## Community
[![Slack](http://s13.postimg.org/ybwy92ktf/Slack.png)](https://zewo-slackin.herokuapp.com)
Join us on [Slack](https://zewo-slackin.herokuapp.com).
License
-------**Aeon** is released under the MIT license. See LICENSE for details.