EONC
EONC is a fast Rest-Application framework for NodeJS, makes building rest applications easy. EONC framework supports endpoints (known as api's), types, global schemas and express/connect middlewares.
const eonc = ;const http = ; const app = eonc; // gzip/deflate outgoing responsesconst compression = ;app; // store session state in browser cookieconst cookieSession = ;app; const ep = eonc; ep; ep; app; //create node.js http server and listen on porthttp;
Getting Started
EONC is a extensible framework that supports both middleware and endpoint.
Install EONC
$ npm install eonc
Create an app
The main component is a EONC "app". This will store all the middleware and endpoint added and is, itself, a function.
const app = eonc;
Create endpoints
Endpoints are the api's in your rest application. An endpoint can handle one, many or all http methods. EONC process type checking and converting for input parameters before calling endpoint handler.
let ep = eonc; // Endpoint will handle GET, PUT and DELETE methodsep;ep;ep;app; ep = eonc;// Endpoint will handle all methodsep;app;
Use types
Type checking and conversion is the powerful part of the EONC framework. It quaranties you will get the exact type of request parameters in your endpoint handler. Defining types is very easy.
1.Type definition objects
ep;
2.Type definition strings
ep;
Use global schemas
Global schemas can be used in an EONC application. This helps you define global types and use them in your endpoints.
let schema1 = eonc;schema1;schema1; let schema2 = eonc;schema2;
Once you created a schema object and define types in it, you can use that types anywhere in your application.
let ep = eonc; ep;
Use middleware
The core of middleware support is extended from connect project. Take a look at connect repository for detailed use of middlewares.
Node Compatibility
- node
>= 6.x
;