Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ardalan Amini committed Jul 9, 2018
2 parents 7138ade + 1f924c8 commit aea6939
Show file tree
Hide file tree
Showing 36 changed files with 1,832 additions and 917 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Changelog

## [next](https://github.com/foxifyjs/foxify/releases/tag/next) - *2018-__-__*
## [v0.8.0](https://github.com/foxifyjs/foxify/releases/tag/v0.8.0) - *2018-07-09*

**Implemented enhancements:**

- added `https` option
- added `https.key` setting
- added `https.cert` setting
- added `json schema` option to routing
- added `stop` ability
- added `reload` ability
- improved performance

## [v0.7.0](https://github.com/foxifyjs/foxify/releases/tag/v0.7.0) - *2018-05-19*
Expand Down
44 changes: 24 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Foxify [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=The%20fast,%20easy%20to%20use%20&%20typescript%20ready%20web%20framework%20for%20Node.js&url=https://github.com/foxifyjs/foxify&via=foxifyjs&hashtags=foxify,nodejs,web,api,framework,typescript,developers,fast)
# Foxify [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Foxify,%20The%20fast,%20easy%20to%20use%20%26%20typescript%20ready%20web%20framework%20for%20Node.js&url=https://github.com/foxifyjs/foxify&via=foxifyjs&hashtags=foxify,nodejs,web,api,framework,typescript,developers,fast)

> Inspired by [Express](https://expressjs.com)
The **fast**, **easy to use** & **typescript ready** web framework for [Node.js](https://nodejs.org)

The **fast**, **easy to use** & **typescript ready** web framework for [Node.js](https://nodejs.org)
> Inspired by [Express](https://expressjs.com)
[![Npm Version](https://img.shields.io/npm/v/foxify.svg)](https://www.npmjs.com/package/foxify)
[![Node Version](https://img.shields.io/node/v/foxify.svg)](https://nodejs.org)
Expand All @@ -21,8 +21,10 @@ The **fast**, **easy to use** & **typescript ready** web framework for [Node

## Table of Contents <!-- omit in toc -->

- [Installation](#installation)
- [Usage](#usage)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Features](#features)
- [Benchmarks](#benchmarks)
- [TODO](#todo)
Expand All @@ -31,16 +33,19 @@ The **fast**, **easy to use** &amp; **typescript ready** web framework for [Node
- [License](#license)
- [Support](#support)

## Installation
## Getting Started

### Prerequisites

- [Node.js](https://nodejs.org/en/download) 8 or higher is required.

Before installing, [download and install Node.js](https://nodejs.org/en/download).
Node.js 8 or higher is required.
### Installation

```bash
npm i -s foxify
```

## Usage
### Usage

```javascript
const Foxify = require('foxify');
Expand All @@ -66,14 +71,14 @@ app.start();

More detailed [sample](https://github.com/foxifyjs/foxify/tree/master/demo) is available.

You can also find all the documents [here](https://foxify.js.org/api.html).
You can also find all the documents [here](https://foxify.js.org).

## Features

- Written in ES6
- Robust routing (faster than `Express`)
- `Express` middleware support
- Robust database modeling ([Odin](https://github.com/foxifyjs/odin))
- Robust database modeling ([`Odin`](https://github.com/foxifyjs/odin))
- Simple and powerful error handling
- Focus on high performance
- HTTP helpers (redirection, etc)
Expand All @@ -83,21 +88,20 @@ You can also find all the documents [here](https://foxify.js.org/api.html).

## Benchmarks

**Machine**: Intel Virtual CPU (2 cores), 2GiB (DDR4)
**Machine**: Ubuntu 18.04 64-bit, Intel Core i7 (8 cores), 8GiB (DDR4)

**Method**: `autocannon -c 100 -d 40 -p 10 localhost:3000` * 2, taking the second average

**sort**: R/S

| Framework | Version | R/S |
|:---------:|:-------:|:---:|
| `http.Server` | **10.1.0** | **71,892** |
| - | - | - |
| fastify | 1.4.0 | 70,793 |
| **Foxify** | **0.7.0** | **61,370** |
| restify | 6.4.0 | 50,616 |
| hapi | 17.4.0 | 42,384 |
| express | 4.16.3 | 41,146 |
| fastify | 1.7.0 | 26,819.6 |
| **bare** | **10.3.0** | **26,410** |
| **Foxify** | **0.8.0** | **23,928.4** |
| restify | 7.2.1 | 14,919.2 |
| hapi | 17.5.2 | 18756.6 |
| express | 4.16.3 | 18,454 |

## TODO

Expand All @@ -107,7 +111,7 @@ You can also find all the documents [here](https://foxify.js.org/api.html).
- [x] View engine
- [x] Options
- [x] Settings
- [x] [Database Model](https://github.com/foxifyjs/odin)
- [x] Database Model ([`Odin`](https://github.com/foxifyjs/odin))
- [x] Clustering
- [ ] File storage
- [ ] Job schedule
Expand Down
27 changes: 18 additions & 9 deletions demo/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,30 @@ routes.get('/', (req, res) => {
})

routes.get('/greet/', (req, res) => {
res.json({ hello: 'world' })
res.json({
hello: 'world'
})
})

const schema = {
title: 'Example Schema',
type: 'object',
properties: {
hello: {
type: 'string'
response: {
200: {
type: 'object',
properties: {
hello: {
type: 'string'
}
}
}
}
};

routes.get('/greet-fast', { schema }, (req, res) => {
res.json({ hello: 'world' })
routes.get('/greet-fast', {
schema
}, (req, res) => {
res.json({
hello: 'world'
})
})

routes.get('/404', (req, res) => {
Expand All @@ -35,4 +44,4 @@ routes.get('/error', async (req, res) => {
throw new Error('Oops!')
})

module.exports = routes
module.exports = routes
2 changes: 1 addition & 1 deletion docs/assets/js/search.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/classes/encapsulation.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ <h3>constructor</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/c2e5e8e/src/exceptions/Encapsulation.ts#L8">exceptions/Encapsulation.ts:8</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/9b9ab08/src/exceptions/Encapsulation.ts#L8">exceptions/Encapsulation.ts:8</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -157,7 +157,7 @@ <h3><span class="tsd-flag ts-flagProtected">Protected</span> _fn</h3>
<div class="tsd-signature tsd-kind-icon">_fn<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/c2e5e8e/src/exceptions/Encapsulation.ts#L8">exceptions/Encapsulation.ts:8</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/9b9ab08/src/exceptions/Encapsulation.ts#L8">exceptions/Encapsulation.ts:8</a></li>
</ul>
</aside>
<div class="tsd-type-declaration">
Expand Down Expand Up @@ -201,7 +201,7 @@ <h3>run</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/c2e5e8e/src/exceptions/Encapsulation.ts#L14">exceptions/Encapsulation.ts:14</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/9b9ab08/src/exceptions/Encapsulation.ts#L14">exceptions/Encapsulation.ts:14</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down
42 changes: 6 additions & 36 deletions docs/classes/engine.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ <h3>Properties</h3>
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class"><a href="engine.html#render" class="tsd-kind-icon">render</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="engine.html#responsepatch" class="tsd-kind-icon">response<wbr>Patch</a></li>
</ul>
</section>
</div>
Expand All @@ -116,7 +115,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> Callback</h3>
<div class="tsd-signature tsd-kind-icon">Callback<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/c2e5e8e/src/view/Engine.ts#L5">view/Engine.ts:5</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/9b9ab08/src/view/Engine.ts#L5">view/Engine.ts:5</a></li>
</ul>
</aside>
<div class="tsd-type-declaration">
Expand Down Expand Up @@ -157,7 +156,7 @@ <h3>constructor</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/c2e5e8e/src/view/Engine.ts#L11">view/Engine.ts:11</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/9b9ab08/src/view/Engine.ts#L11">view/Engine.ts:11</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -197,7 +196,7 @@ <h3><span class="tsd-flag ts-flagProtected">Protected</span> _ext</h3>
<div class="tsd-signature tsd-kind-icon">_ext<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/c2e5e8e/src/view/Engine.ts#L10">view/Engine.ts:10</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/9b9ab08/src/view/Engine.ts#L10">view/Engine.ts:10</a></li>
</ul>
</aside>
</section>
Expand All @@ -207,7 +206,7 @@ <h3><span class="tsd-flag ts-flagProtected">Protected</span> _handler</h3>
<div class="tsd-signature tsd-kind-icon">_handler<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/c2e5e8e/src/view/Engine.ts#L11">view/Engine.ts:11</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/9b9ab08/src/view/Engine.ts#L11">view/Engine.ts:11</a></li>
</ul>
</aside>
<div class="tsd-type-declaration">
Expand Down Expand Up @@ -238,7 +237,7 @@ <h3><span class="tsd-flag ts-flagProtected">Protected</span> _path</h3>
<div class="tsd-signature tsd-kind-icon">_path<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/c2e5e8e/src/view/Engine.ts#L9">view/Engine.ts:9</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/9b9ab08/src/view/Engine.ts#L9">view/Engine.ts:9</a></li>
</ul>
</aside>
</section>
Expand All @@ -255,7 +254,7 @@ <h3>render</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/c2e5e8e/src/view/Engine.ts#L19">view/Engine.ts:19</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/9b9ab08/src/view/Engine.ts#L19">view/Engine.ts:19</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -274,32 +273,6 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a name="responsepatch" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> response<wbr>Patch</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
<li class="tsd-signature tsd-kind-icon">response<wbr>Patch<span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ServerResponse</span>, engine<span class="tsd-signature-symbol">?: </span><a href="engine.html" class="tsd-signature-type">Engine</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ServerResponse</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/c2e5e8e/src/view/Engine.ts#L23">view/Engine.ts:23</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>res: <span class="tsd-signature-type">ServerResponse</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> engine: <a href="engine.html" class="tsd-signature-type">Engine</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ServerResponse</span></h4>
</li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
Expand Down Expand Up @@ -338,9 +311,6 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ServerRes
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="engine.html#render" class="tsd-kind-icon">render</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a href="engine.html#responsepatch" class="tsd-kind-icon">response<wbr>Patch</a>
</li>
</ul>
</li>
</ul>
Expand Down
Loading

0 comments on commit aea6939

Please sign in to comment.