Skip to content

itivanov/node-json-api-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js JSON API Server

Usage

const api = require('node-json-api-server');

api.start(8000);

api.handle('ping', ping);

function ping(data) {
    var out = {
        response: api.status.OK,
        data: 'pong'
    };

    return out;
}
curl -X POST -d '{"method":"ping"}' http://localhost:8000/

{"response":{"status":200},"data":"pong"}

About

Node.js JSON API Server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published