Skip to content

Codebase API wrapper for NodeJS

Notifications You must be signed in to change notification settings

demodern/node-codebase

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

node-codebase (API wrapper for Node.js)

A NodeJS wrapper for the CodeBaseHQ API.

Install from NPM

npm install node-codebase

Example usage

var http = require('http'),
    Codebase = require('codebase');

process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0 

var cb = new Codebase(
    'api url',
    'account/username:apikey'
);

http.createServer(function (req, res) {
    
    if (req.url !== '/') {
        res.end();
        return;
    }

    cb.activity(function (err, data) {
      if (err) {
        res.end('There was an error!' + data);
      }
  
      res.end(JSON.stringify(data));
    });

}).listen(8080);

console.log('Server running at http://localhost:8080/');

Config

API URL should be the following in most cases: 'api3.codebasehq.com'

Theres a bug in node, to be able to connect add the following line before calling codebase:

process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0

TODO

  • Write documentation
  • Finish "tickets.attachments.upload" method

About

Codebase API wrapper for NodeJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%