apigeon

7.1.0 • Public • Published

Apigeon

Dependency Status

An npm plugin to generate a server application. It can be used with either standard http requests or websockets.

Installation

npm install apigeon

Usage

A basic example of how to use Apigeon.

'use strict'

const Url = require( 'url' )
const Apigeon = require( 'apigeon' )

const PORT = 8080

let server = new Apigeon( {
  mode: {
    http: true,
    socket: true
  },
  httpRoutes: ( url ) => {
    let urlParts = Url.parse( url )
    return require( __dirname + '/routes/http' + urlParts.pathname )
  },
  socketRoutes: ( url ) => {
    let urlParts = Url.parse( url )
    return require( __dirname + '/routes/socket' + urlParts.pathname )
  }
} )

server.start( PORT )

API

Class Api documentation
Apigeon https://github.com/vladfilipro/apigeon/blob/master/docs/apigeon.md
ConnectionClass https://github.com/vladfilipro/apigeon/blob/master/docs/connection.md
ErrorClass https://github.com/vladfilipro/apigeon/blob/master/docs/error.md
RouteClass https://github.com/vladfilipro/apigeon/blob/master/docs/route.md
HttpRouteClass https://github.com/vladfilipro/apigeon/blob/master/docs/httproute.md
SocketRouteClass https://github.com/vladfilipro/apigeon/blob/master/docs/socketroute.md

Examples

In order to run the examples provided with the package, clone the repository found in github, and then run the following commands:

npm install


  • To test the examples:
node test

Package Sidebar

Install

npm i apigeon

Weekly Downloads

31

Version

7.1.0

License

SEE LICENSE IN LICENSE

Unpacked Size

29.5 kB

Total Files

29

Last publish

Collaborators

  • vladfilipro