<commit_before># SYNTHIFY

A minimalist component-ized fork of Jon Abrams synth. The easiest web framework for synthesizing API-first web apps that also have web front-ends.

## Install

`npm install git+https://github.com/ssr1ram/synthify.git`

## Example

```js
var express = require('express');
var synthify = require('synthify')

var app = express();

var synthoptions = {
    basedir: "back/resources"
};

synthify.resources(app, synthoptions);

var server = app.listen(3000, function() {
        console.log('Listening on port %d', server.address().port);
});
```

For a more full featured product and the source of inspiration for this please see [synthjs.com](http://www.synthjs.com).

## License

[MIT](https://github.com/ssr1ram/synthify/blob/master/LICENSE)

## Credit

- Original Creators
- This project was inspired by synthjs created by <NAME> ([Twitter](https://twitter.com/JonathanAbrams) | [GitHub](https://github.com/JonAbrams)).
<commit_msg>Added resources documentation to Readme<commit_after># SYNTHIFY

A minimalist component-ized fork of Jon Abrams synth. The easiest web framework for synthesizing API-first web apps that also have web front-ends.

## Install

`npm install git+https://github.com/ssr1ram/synthify.git`

## Example


```js
var express = require('express');
var synthify = require('synthify')

var app = express();

var synthoptions = {
    basedir: "back/resources"
};

synthify.resources(app, synthoptions);

var server = app.listen(3000, function() {
        console.log('Listening on port %d', server.address().port);
});
```

Given a directory structire like

```
back/
    resources/
        tweets/
            getIndex.js
```

Where getIndex.js has functions using the following syntax

```
You can then declare a request handler for a specific HTTP method in any file that is in the resources directory by assigning a function to exports.<method><optional: ActionName>.

Possible function names:

exports.get: Creates a get method that will expect the resources ID. It will handle a request of this form, for example: /api/memoes/124
exports.getIndex: Special version of get that won't expect a resource ID. e.g. GET /api/memoes. Use this for getting a list of resources.
exports.post: Handles post requests, does not expect a resource ID. e.g. POST /api/memoes. Use this for created new resources.
exports.put: Similar to exports.get but will respond to requests using the put method. Use this for making changes to the specified resource.
exports.delete: Similar to exports.get but will respond to requests using the delete method. Use this to delete the specified resource.
exports.getAnything_else: Create custom actions for a resource by using one of the four methods followed by a custom name. e.g. exports.postPublish responds to POST /api/memoes/publish?id=124.
```

For a more full featured product and the source of inspiration for this please see [synthjs.com](http://www.synthjs.com).

## License

[MIT](https://github.com/ssr1ram/synthify/blob/master/LICENSE)

## Credit

- Original Creators
- This project was inspired by synthjs created by <NAME> ([Twitter](https://twitter.com/JonathanAbrams) | [GitHub](https://github.com/JonAbrams)).

{'fraction_non_alphanumeric': 0.1065625, 'fraction_numerical': 0.005625, 'mean_word_length': 4.290909090909091, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, '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': '1581630', 'n_tokens_mistral': 967, 'n_tokens_neox': 910, 'n_words': 354}