Git Product home page Git Product logo

feathers's Introduction

Feathers

Let your web app fly.

Build Status

Feathers is a light weight web application framework that rides on top of Express. It makes it easy to create RESTful web services and real-time applications using socket.io.

The core focus of Feathers is your data. We believe that ultimately your app's purpose is to manage data in some fashion and so that's all you should really need to deal with. Managing your data.

Install

As with any NodeJS module, just install it as a dependency in your application:

npm install feathers --save

Getting Started Is Easy

Building an app with Feathers is easy. There are only 4 things to worry about. A wrapped express server, providers, services & middleware. Services are just simple modules that expose certain methods to the providers in order to CRUD your data. We can easily initialize a service that say... provides a single Todo:

var feathers = require('feathers');

var todoService = {
  get: function(name, params, callback) {
    callback(null, {
      id: name,
      description: "You have to do " + name + "!"
    });
  }
};

feathers()
	.configure(feathers.socketio())
	.use('/todo', todoService)
	.listen(8000);

That's all there really is to building an app with Feathers.

REST

You can access the REST service by going to http://localhost:8000/todo/dishes in your browser and will see:

{
  "id": "dishes",
  "description": "You have to do dishes!"
}

Note: Query parameters like http://localhost:8000/todo/dishes?type=dirty will be passed as params.query

SocketIO

Since we configured our app with feathers.socketio(), you can also connect to your service via SocketIO. Create an HTML page and insert the following code to see the response data logged on the console:

<script src="http://localhost:8000/socket.io/socket.io.js"></script>
<script>
  var socket = io.connect('http://localhost:8000/');
  socket.emit('todo::get', 'laundry', {}, function(error, data) {
    console.log(data); // -> { id: 'laundry', description: 'You have to do laundry!' }
  });
</script>

What's next?

Head over to the Feathers website at feathersjs.com for more examples and the detailed documenation.

feathers's People

Contributors

daffl avatar ekryski avatar

Watchers

mixxmac avatar James Cloos avatar  avatar

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.