<commit_before># Blackfish

A Node/Express Inspired Web Framework for Swift that works on iOS, OS X, and Ubuntu.

![Travis Badge](https://travis-ci.org/elliottminns/blackfish.svg?branch=master)

- [x] Insanely fast
- [x] Single Threaded
- [x] Beautiful syntax
- [x] Type safe

## Getting Started

You must have Swift 2.2 or later installed. You can learn more about Swift 2.2 at [Swift.org](http://swift.org)

### Work in Progress

This is a work in progress and will likely change frequently, pull requests are welcome!

## Server

Starting the server is as simple as express.

`main.swift`
```swift
import Blackfish

let app = Blackfish()

app.get("/") { request, response in
    response.send("Hello World!")
}

app.listen(port: 3000) { error in
    if error == nil {
        print("Example app listening on port 3000")
    }
}
```

If you are having trouble connecting, make sure your ports are open. Check out `apt-get ufw` for simple port management.

## Routing

Routing in Blackfish is simple and very similar to Express.

`main.swift`
```swift
app.get("/welcome") { request, response in
	response.send(text: "Hello")
}

app.post('/') { request, response in
    response.send(text: 'Got a POST request')
});

//...start server
```

### Router<commit_msg>Fix `response.send` in README.md<commit_after># Blackfish

A Node/Express Inspired Web Framework for Swift that works on iOS, OS X, and Ubuntu.

![Travis Badge](https://travis-ci.org/elliottminns/blackfish.svg?branch=master)

- [x] Insanely fast
- [x] Single Threaded
- [x] Beautiful syntax
- [x] Type safe

## Getting Started

You must have Swift 2.2 or later installed. You can learn more about Swift 2.2 at [Swift.org](http://swift.org)

### Work in Progress

This is a work in progress and will likely change frequently, pull requests are welcome!

## Server

Starting the server is as simple as express.

`main.swift`
```swift
import Blackfish

let app = Blackfish()

app.get("/") { request, response in
    response.send(text: "Hello World!")
}

app.listen(port: 3000) { error in
    if error == nil {
        print("Example app listening on port 3000")
    }
}
```

If you are having trouble connecting, make sure your ports are open. Check out `apt-get ufw` for simple port management.

## Routing

Routing in Blackfish is simple and very similar to Express.

`main.swift`
```swift
app.get("/welcome") { request, response in
	response.send(text: "Hello")
}

app.post('/') { request, response in
    response.send(text: 'Got a POST request')
});

//...start server
```

### Router
{'fraction_non_alphanumeric': 0.12436249509611612, 'fraction_numerical': 0.009415457041977247, 'mean_word_length': 3.7842401500938085, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1609335', 'n_tokens_mistral': 848, 'n_tokens_neox': 793, 'n_words': 311}