Giter VIP home page Giter VIP logo

leafnode's Introduction

Carbon.io

Travis build status npm Version npm downloads supported node versions MIT License

Carbon.io is an application framework based on Node.js and MongoDB for building command line programs, microservices, and APIs.

With Carbon.io you can create simple, database-centric microservices with virtually no code. At the same time Carbon.io is designed to let you under the hood and allows you to write highly customized APIs much like you would with lower-level libraries such as Express.js.

Quickstart

To install:

$ npm install carbon-io

Copy the following code into service.js:

var carbon = require('carbon-io')

var o  = carbon.atom.o(module).main
var __ = carbon.fibers.__(module)

__(function() {
  module.exports = o({
    _type: carbon.carbond.Service,
    port: 8888,
    endpoints: {
      hello: o({
        _type: carbon.carbond.Endpoint,
        get: function(req) {
          return { msg: "Hello world!" }
        }
      })
    }
  })
})

This will create a Carbon.io service which will respond with "Hello world!" on the /hello endpoint. Run the service with:

$ node service

And test it using:

$ curl localhost:8888/hello

Documentation

Interested in getting started with Carbon.io? Check out our detailed documentation on the Carbon.io website.

Contributing

Interested in contributing to Carbon.io? We love to receive new contributions! There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests or writing code which can be incorporated into Carbon.io itself.

Check out our CONTRIBUTING.md for tips on how to get started!

License

MIT License

leafnode's People

Contributors

benelgar avatar gregbanks avatar tfogo avatar willshulman avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

abdulito

leafnode's Issues

Bad reference in collection.js

[Fri Mar 31 2017 12:26:18 GMT-0700 (PDT)] ERROR: TypeError: Cannot read property 'length' of undefined
    at Collection.saveObject (/Users/will/src/github/carbon-io/example__contacts-api/node_modules/carbon-io/node_modules/@carbon-io/carbon-core/node_modules/@carbon-io/leafnode/lib/collection.js:635:14)

Code is:

Collection.prototype.saveObject = function(doc, options) {
  var ret = this.save.apply(this, arguments)
  if (ret.ops.length !== 1) {
    throw new Error(ret.ops.length + ' documents inserted, expected 1')
  }
  return ret.ops[0]
}

ret.opts can be undefined

Repetition in tests

I notice in CreateCollectionTest we create a collection, drop it, create it again, and drop it again. Is there a particular reason for doing it twice?

Cleanup of tests

  • Wrap all in __ (once ensure is done). Right now one can't run individual tests outside the whole suite.

  • Filenames to naming conventions. Atom components cap camel case. Libs kebab case. Exception is index.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.