<commit_before>
# Dynamo - Dynamic Swift Web Server

Starting this project the intention was to code the simplest possible Web Server entirely
in Swift. Unfortunately I got a bit carried away adding features and besides this spot has been
capably occupied by the [swifter](https://github.com/glock45/swifter) server along with it's
Swift syntactic sugar.

So.. while Dynamo can be used in an iOS application as is demonstrated in this project, the focus
has turned to the server side to set up a simple framework inside which it is possible to experiment
with SSL, Proxies and what you could call "Swift Server Pages" which are loadable bundles of code
placed in the document hierarchy.

The Dynamo server core is based on "Swiftlets", instances implementing the DynamoSwiftlet which are
presented with incoming HTTP requests from the browser and can choose to process it in any manner it
chooses. The developer passes in an array of swiftlet instances combining the features and applications 
desired on server startup.

```Swift
    @objc public protocol DynamoSwiftlet {

        @objc func process( httpClient: DynamoHTTPConnection ) -> DynamoProcessed    
    }

    @objc public enum DynamoProcessed : Int {
        case
            NotProcessed, // does not recognise the request
            Processed, // has processed the request
            ProcessedAndReusable // "" and connection may be reused in HTTP/1.1
    }
```

The Swiftlets included in the framework are as follows

### DynamoDocumentSwiftlet

The default swiftlet to serve documents from ~/Sites/host:port or the applications resources directory for iOS.

### DynamoProxySwiftlet, DynamoSSLProxySwiftlet

Dynamo can act as a proxy server logging what can be a surprising about of traffic from your browser.

### DynamoApplicationSwiftlet, DynamoSessionSwiftlet

DynamoApplicationSwiftlet is the abstract superclass of all "application" swiftlets parsing browser GET and POST
parameters and any Cookies. DynamoSessionSwiftlet adds the ability to have an application Swiftlet
created separately for each unique web user using Cookies.

### DynamoBundleSwiftlet, DynamoServerPagesSwiftlet

DynamoBundleSwiftlet, loads a swiftlet from a bundle with extension ".ssp" in an OSX application's resources.
A simple python script can generate the Swift source for the bundle from a ".shtml" mixing HTML and Swift
language. The DynamoServerPagesSwiftlet takes this a step further where the bundle is loaded from the
document root for the sever when used from the command line. If the bundle is updated for new functionality,
provided it contains the "AutoLoader.m" stub the new code will be "swizzled" into operation.
<commit_msg>Rewrite of README<commit_after>
# Dynamo - Dynamic Swift Web Server

Starting this project the intention was to code the simplest possible Web Server entirely
in Swift. Unfortunately I got a bit carried away adding features and besides this spot has been
capably occupied by the [swifter](https://github.com/glock45/swifter) server along with it's
Swift syntactic sugar.

So.. while Dynamo can be used in an iOS application as is demonstrated in this project, the focus
has turned to the server side to set up a simple framework inside which it is possible to experiment
with SSL, Proxies and what you could call "Swift Server Pages" which are loadable bundles of code
placed in the document hierarchy.

The Dynamo server core is based on "Swiftlets", instances implementing the DynamoSwiftlet which are
presented with incoming HTTP requests from the browser and can choose to process it in any manner it
chooses. The developer passes in an array of swiftlet instances combining the features and applications 
desired on server startup.

```Swift
    @objc public protocol DynamoSwiftlet {

        @objc func process( httpClient: DynamoHTTPConnection ) -> DynamoProcessed    
    }

    @objc public enum DynamoProcessed : Int {
        case
            NotProcessed, // does not recognise the request
            Processed, // has processed the request
            ProcessedAndReusable // "" and connection may be reused in HTTP/1.1
    }
```

For further information about the classes and protools that make up Dynamo please consult the jazzy docs
[here](http://johnholdsworth.com/dynamo/docs/). The Swiftlets included in the framework are as follows:

### DynamoDocumentSwiftlet

The default swiftlet to serve documents from ~/Sites/host:port or the applications resources directory for iOS.

### DynamoProxySwiftlet, DynamoSSLProxySwiftlet

Dynamo can act as a proxy server logging what can be a surprising about of traffic from your browser.

### DynamoApplicationSwiftlet, DynamoSessionSwiftlet

DynamoApplicationSwiftlet is the abstract superclass of all "application" swiftlets parsing browser GET and POST
parameters and any Cookies. DynamoSessionSwiftlet adds the ability to have an application Swiftlet
created separately for each unique web user using Cookies.

### DynamoBundleSwiftlet, DynamoServerPagesSwiftlet

DynamoBundleSwiftlet, loads a swiftlet from a bundle with extension ".ssp" in an OSX application's resources.
A simple python script can generate the Swift source for the bundle from a ".shtml" mixing HTML and Swift
language. The DynamoServerPagesSwiftlet takes this a step further where the bundle is loaded from the
document root for the sever when used from the command line. If the bundle is updated for new functionality,
provided it contains the "AutoLoader.m" stub the new code will be "swizzled" into operation.

{'fraction_non_alphanumeric': 0.03990610328638498, 'fraction_numerical': 0.001444564824846515, 'mean_word_length': 4.346525096525096, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1100961', 'n_tokens_mistral': 1433, 'n_tokens_neox': 1302, 'n_words': 746}