JSPM

  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q50929F
  • License MIT

The fast, easy to use & typescript ready web framework for Node.js

Package Exports

  • foxify
  • foxify/framework/routing

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (foxify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Foxify Logo

Foxify

The fast, easy to use & typescript ready web framework for Node.js

Inspired by Express

npm version npm monthly downloads open issues closed issues license github stars github stars

NOTE: before the first major version there might be so many major changes; so be warned!

Installation

Before installing, download and install Node.js. Node.js 6.4.0 or higher is required.

npm i -s foxify

Usage

const Foxify = require('foxify');

let app = new Foxify();

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

// create an error
app.get('/error', (req, res) => {
        throw new Error('I Failed :(');
});

// create an http error
app.get('/404', (req, res) => {
        throw new HttpExeption('Not Found', 404);
});

app.start();

More detailed sample is available.

You can also find all the documents here.

Features

  • Written in ES6
  • Robust routing (faster than Express)
  • Express middleware support
  • Robust database modeling (mongodb)
  • Simple and powerful error handling
  • Focus on high performance
  • HTTP helpers (redirection, etc)
  • View system supporting lots of template engines
  • Content negotiation
  • Executable for generating applications quickly

Benchmarks

Machine: Intel Virtual CPU (2 cores), 2GiB (DDR4)

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

sort: Request / Second

Framework Version R/S
http.Server 9.5.0 54,669
- - -
fastify 1.0.0-rc.2 43,746
Foxify 0.5.2 42,862
Restify 6.3.4 37,006
Express 4.16.2 31,040
Hapi 17.2.0 29,476

TODO

  • Routing
  • Middleware support
  • Error handling
  • View engine
  • Options
  • Settings
  • Database
    • MySQL ?
    • MongoDB
      • graphql support
      • schema validation
      • Relations
        • hasOne relation
        • hasMany relation
        • Create operation
        • Read operation
        • Update operation
        • Delete operation
  • Clustering
  • File storage
  • Job schedule
  • Logging

Support

If my work helps you, please consider

Buy Me A Coffee