7.1.0 • Published 7 years ago
apigeon v7.1.0
Apigeon
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
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
- Navigate to :
- http://localhost:8080 - you should get a 500 error
- http://localhost:8080/?message=hello - you should get a text "Hello!"
- http://localhost:8080/?message=redirect - you should be taken to github
7.1.0
7 years ago
7.0.1
7 years ago
7.0.0
7 years ago
6.2.1
7 years ago
6.2.0
7 years ago
6.1.2
7 years ago
6.1.1
7 years ago
6.1.0
7 years ago
6.0.0
7 years ago
5.0.0
7 years ago
4.1.1
7 years ago
4.1.0
7 years ago
4.0.2
8 years ago
4.0.1
8 years ago
4.0.0
8 years ago
3.4.2
8 years ago
3.4.1
8 years ago
3.4.0
8 years ago
3.3.0
8 years ago
3.2.1
8 years ago
3.2.0
8 years ago
3.1.4
8 years ago
3.1.3
8 years ago
3.1.2
8 years ago
3.1.1
8 years ago
3.1.0
8 years ago
3.0.3
8 years ago
3.0.2
8 years ago
3.0.1
8 years ago
3.0.0
8 years ago