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 Oct 1, 2018
2 parents 950855a + b462035 commit 9b087b4
Show file tree
Hide file tree
Showing 67 changed files with 12,261 additions and 2,574 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@

---

## [v0.10.0](https://github.com/foxifyjs/foxify/releases/tag/v0.10.0) - *(2018-10-02)*

- :zap: Added event listening ability to `Server` for custom error handlers
- :zap: Added `route` handler to `Router`
- :zap: Added param handler to `Router`
- :star2: Improved `Routing` performance (about 30% faster)

## [v0.9.0](https://github.com/foxifyjs/foxify/releases/tag/v0.9.0) - *(2018-08-21)*

- :zap: Added `subdomain.offset` setting
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# 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) [![Twitter Follow](https://img.shields.io/twitter/follow/foxifyjs.svg?style=social&label=Follow)](https://twitter.com/foxifyjs)


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

> Inspired by [Express](https://expressjs.com)
Expand All @@ -23,9 +22,9 @@ The **fast**, **easy to use** & **typescript ready** web framework for [Node.js]
## Table of Contents <!-- omit in toc -->

- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Features](#features)
- [Benchmarks](#benchmarks)
- [TODO](#todo)
Expand Down Expand Up @@ -77,7 +76,7 @@ You can also find all the documents [here](https://foxify.js.org).
## Features

- Written in ES6
- Robust routing (faster than `Express`)
- Robust routing (about 60% faster than `Express`)
- `Express` middleware support
- Robust database modeling ([`Odin`](https://github.com/foxifyjs/odin))
- Simple and powerful error handling
Expand All @@ -86,6 +85,7 @@ You can also find all the documents [here](https://foxify.js.org).
- View system supporting lots of template engines
- Content negotiation
- Executable for generating applications quickly
- Error handling

## Benchmarks

Expand All @@ -95,14 +95,14 @@ You can also find all the documents [here](https://foxify.js.org).

**sort**: R/S

| Framework | Version | R/S |
|:---------:|:-------:|:---:|
| 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 |
| Framework | Version | R/S |
| :--------: | :---------: | :----------: |
| fastify | 1.11.2 | 27,112 |
| **Foxify** | **0.10.0** | **26,702.4** |
| **bare** | **10.10.0** | **21,476.8** |
| hapi | 17.5.4 | 19,755.2 |
| express | 4.16.3 | 16,408.8 |
| restify | 7.2.1 | 15,474.4 |

## TODO

Expand Down Expand Up @@ -138,4 +138,4 @@ If my work helps you, please consider

[![Become A Patron](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/ardalanamini)

[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/ardalanamini)
[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/ardalanamini)
8 changes: 4 additions & 4 deletions demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ const app = new Foxify();
// template engine support
app.engine("ejs", path.join(__dirname, "views"), require("ejs").__express)

// middlewares
// middlewares & routes
app.use(
Foxify.static(path.join(__dirname, "public")), // static serve support
morgan("dev"), // express middleware support
index // routes
);

// routes
app.use(index);

// start the app
app.start(() =>
console.log(`Foxify server running at http://${app.get("url")}:${app.get("port")} (worker: ${process.pid})`));

console.log(app.prettyPrint());
6 changes: 3 additions & 3 deletions demo/routes/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Foxify = require('../../framework')

let routes = new Foxify.Route()
const routes = new Foxify.Router()

routes.get('/', (req, res) => {
res.render('index', {
Expand All @@ -9,7 +9,7 @@ routes.get('/', (req, res) => {
})
})

routes.get('/greet/', (req, res) => {
routes.get('/greet', (req, res) => {
res.json({
hello: 'world'
})
Expand Down Expand Up @@ -37,7 +37,7 @@ routes.get('/greet-fast', {
})

routes.get('/404', (req, res) => {
throw new HttpException(404)
throw new HttpException("This is a demo", 404)
})

routes.get('/error', async (req, res) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/search.js

Large diffs are not rendered by default.

72 changes: 3 additions & 69 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/5c2b943/src/exceptions/Encapsulation.ts#L9">exceptions/Encapsulation.ts:9</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/269cc10/src/exceptions/Encapsulation.ts#L15">exceptions/Encapsulation.ts:15</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/5c2b943/src/exceptions/Encapsulation.ts#L9">exceptions/Encapsulation.ts:9</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/269cc10/src/exceptions/Encapsulation.ts#L15">exceptions/Encapsulation.ts:15</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/5c2b943/src/exceptions/Encapsulation.ts#L15">exceptions/Encapsulation.ts:15</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/269cc10/src/exceptions/Encapsulation.ts#L21">exceptions/Encapsulation.ts:21</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -250,72 +250,6 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-class">
<a href="engine.html" class="tsd-kind-icon">Engine</a>
</li>
<li class=" tsd-kind-class">
<a href="foxify.html" class="tsd-kind-icon">Foxify</a>
</li>
<li class=" tsd-kind-class">
<a href="httpexception.html" class="tsd-kind-icon">Http<wbr>Exception</a>
</li>
<li class=" tsd-kind-class">
<a href="request.html" class="tsd-kind-icon">Request</a>
</li>
<li class=" tsd-kind-class">
<a href="response.html" class="tsd-kind-icon">Response</a>
</li>
<li class=" tsd-kind-class">
<a href="route.html" class="tsd-kind-icon">Route</a>
</li>
<li class=" tsd-kind-class">
<a href="router.html" class="tsd-kind-icon">Router</a>
</li>
<li class=" tsd-kind-class">
<a href="server.html" class="tsd-kind-icon">Server</a>
</li>
<li class=" tsd-kind-variable tsd-is-not-exported">
<a href="../globals.html#status_codes" class="tsd-kind-icon">STATUS_<wbr>CODES</a>
</li>
<li class=" tsd-kind-variable tsd-is-not-exported">
<a href="../globals.html#charsetregexp" class="tsd-kind-icon">charset<wbr>Reg<wbr>Exp</a>
</li>
<li class=" tsd-kind-variable tsd-is-not-exported">
<a href="../globals.html#resolve" class="tsd-kind-icon">resolve</a>
</li>
<li class=" tsd-kind-function tsd-is-not-exported">
<a href="../globals.html#acceptparams" class="tsd-kind-icon">accept<wbr>Params</a>
</li>
<li class=" tsd-kind-function">
<a href="../globals.html#define" class="tsd-kind-icon">define</a>
</li>
<li class=" tsd-kind-function">
<a href="../globals.html#init" class="tsd-kind-icon">init</a>
</li>
<li class=" tsd-kind-function tsd-is-not-exported">
<a href="../globals.html#isabsolute" class="tsd-kind-icon">is<wbr>Absolute</a>
</li>
<li class=" tsd-kind-function">
<a href="../globals.html#mixins" class="tsd-kind-icon">mixins</a>
</li>
<li class=" tsd-kind-function tsd-is-not-exported">
<a href="../globals.html#normalizetype" class="tsd-kind-icon">normalize<wbr>Type</a>
</li>
<li class=" tsd-kind-function tsd-is-not-exported">
<a href="../globals.html#normalizetypes" class="tsd-kind-icon">normalize<wbr>Types</a>
</li>
<li class=" tsd-kind-function tsd-is-not-exported">
<a href="../globals.html#sendfile" class="tsd-kind-icon">sendfile</a>
</li>
<li class=" tsd-kind-function tsd-is-not-exported">
<a href="../globals.html#setcharset" class="tsd-kind-icon">set<wbr>Charset</a>
</li>
<li class=" tsd-kind-function tsd-is-private tsd-is-not-exported">
<a href="../globals.html#stringify" class="tsd-kind-icon">stringify</a>
</li>
<li class=" tsd-kind-object-literal">
<a href="../globals.html#http" class="tsd-kind-icon">HTTP</a>
</li>
</ul>
</nav>
</div>
Expand Down
78 changes: 6 additions & 72 deletions docs/classes/engine.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,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/5c2b943/src/view/Engine.ts#L5">view/Engine.ts:5</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/269cc10/src/view/Engine.ts#L5">view/Engine.ts:5</a></li>
</ul>
</aside>
<div class="tsd-type-declaration">
Expand Down Expand Up @@ -156,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/5c2b943/src/view/Engine.ts#L11">view/Engine.ts:11</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/269cc10/src/view/Engine.ts#L11">view/Engine.ts:11</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -196,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/5c2b943/src/view/Engine.ts#L10">view/Engine.ts:10</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/269cc10/src/view/Engine.ts#L10">view/Engine.ts:10</a></li>
</ul>
</aside>
</section>
Expand All @@ -206,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/5c2b943/src/view/Engine.ts#L11">view/Engine.ts:11</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/269cc10/src/view/Engine.ts#L11">view/Engine.ts:11</a></li>
</ul>
</aside>
<div class="tsd-type-declaration">
Expand Down Expand Up @@ -237,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/5c2b943/src/view/Engine.ts#L9">view/Engine.ts:9</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/269cc10/src/view/Engine.ts#L9">view/Engine.ts:9</a></li>
</ul>
</aside>
</section>
Expand All @@ -254,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/5c2b943/src/view/Engine.ts#L19">view/Engine.ts:19</a></li>
<li>Defined in <a href="https://github.com/foxifyjs/foxify/blob/269cc10/src/view/Engine.ts#L19">view/Engine.ts:19</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -285,9 +285,6 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-class">
<a href="encapsulation.html" class="tsd-kind-icon">Encapsulation</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-class">
Expand Down Expand Up @@ -315,69 +312,6 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-class">
<a href="foxify.html" class="tsd-kind-icon">Foxify</a>
</li>
<li class=" tsd-kind-class">
<a href="httpexception.html" class="tsd-kind-icon">Http<wbr>Exception</a>
</li>
<li class=" tsd-kind-class">
<a href="request.html" class="tsd-kind-icon">Request</a>
</li>
<li class=" tsd-kind-class">
<a href="response.html" class="tsd-kind-icon">Response</a>
</li>
<li class=" tsd-kind-class">
<a href="route.html" class="tsd-kind-icon">Route</a>
</li>
<li class=" tsd-kind-class">
<a href="router.html" class="tsd-kind-icon">Router</a>
</li>
<li class=" tsd-kind-class">
<a href="server.html" class="tsd-kind-icon">Server</a>
</li>
<li class=" tsd-kind-variable tsd-is-not-exported">
<a href="../globals.html#status_codes" class="tsd-kind-icon">STATUS_<wbr>CODES</a>
</li>
<li class=" tsd-kind-variable tsd-is-not-exported">
<a href="../globals.html#charsetregexp" class="tsd-kind-icon">charset<wbr>Reg<wbr>Exp</a>
</li>
<li class=" tsd-kind-variable tsd-is-not-exported">
<a href="../globals.html#resolve" class="tsd-kind-icon">resolve</a>
</li>
<li class=" tsd-kind-function tsd-is-not-exported">
<a href="../globals.html#acceptparams" class="tsd-kind-icon">accept<wbr>Params</a>
</li>
<li class=" tsd-kind-function">
<a href="../globals.html#define" class="tsd-kind-icon">define</a>
</li>
<li class=" tsd-kind-function">
<a href="../globals.html#init" class="tsd-kind-icon">init</a>
</li>
<li class=" tsd-kind-function tsd-is-not-exported">
<a href="../globals.html#isabsolute" class="tsd-kind-icon">is<wbr>Absolute</a>
</li>
<li class=" tsd-kind-function">
<a href="../globals.html#mixins" class="tsd-kind-icon">mixins</a>
</li>
<li class=" tsd-kind-function tsd-is-not-exported">
<a href="../globals.html#normalizetype" class="tsd-kind-icon">normalize<wbr>Type</a>
</li>
<li class=" tsd-kind-function tsd-is-not-exported">
<a href="../globals.html#normalizetypes" class="tsd-kind-icon">normalize<wbr>Types</a>
</li>
<li class=" tsd-kind-function tsd-is-not-exported">
<a href="../globals.html#sendfile" class="tsd-kind-icon">sendfile</a>
</li>
<li class=" tsd-kind-function tsd-is-not-exported">
<a href="../globals.html#setcharset" class="tsd-kind-icon">set<wbr>Charset</a>
</li>
<li class=" tsd-kind-function tsd-is-private tsd-is-not-exported">
<a href="../globals.html#stringify" class="tsd-kind-icon">stringify</a>
</li>
<li class=" tsd-kind-object-literal">
<a href="../globals.html#http" class="tsd-kind-icon">HTTP</a>
</li>
</ul>
</nav>
</div>
Expand Down
Loading

0 comments on commit 9b087b4

Please sign in to comment.