Вы находитесь на странице: 1из 6

13/4/2016

feathersjs.com
GITHUB (HTTPS://GITHUB.COM/FEATHERSJS/FEATHERS)

DOCUMENTATION (HTTP://DOCS.FEATHERSJS.COM)

BLOG (HTTPS://BLOG.FEATHERSJS.COM/)

SUPPORT (HTTP://DOCS.FEATHERSJS.COM/HELP/README.HTML)

Aminimalistrealtimeframeworkfortomorrow'sapps.

Get Started (http://docs.feathersjs.com)

Buildincredibleappsinrecordtime.

With Feathers you can build prototypes in minutes and production ready realtime apps in days. Seriously.

13/4/2016

feathersjs.com

Createyourfirstrealtimeappinminutes.
$npminstallgfeatherscli
$mkdirmyapp
$cdmyapp
$feathersgenerate
$npmstart

Checkoutthedocs(http://docs.feathersjs.com)tolearnmoreaboutFeathers,feelfreesayhello
intheSlackgroup(http://slack.feathersjs.com),orshowussomeloveonTwitter
(https://twitter.com/feathersjs).

Staynimblewithelegant,flexiblecode.
We'renotjusthidingbehindgenerators.Seejusthoweasyitistocreateareal
timeappfromscratch,completewithauthentication.

13/4/2016

feathersjs.com

#Installmodulardependencies

$npminstallfeathersfeathershooksfeatherssocketiofeathersrestfeatherserrorsfeathersmemoryfeathersauth

SERVER

BROWSER

REACT NATIVE

const feathers = require('feathers');

const rest = require('feathers-rest');

const socketio = require('feathers-socketio');

const hooks = require('feathers-hooks');

const memory = require('feathers-memory');

const authentication = require('feathers-authentication');

const bodyParser = require('body-parser');

const handler = require('feathers-errors/handler');

9
10

// A Feathers app is the same as an Express app

11

const app = feathers();

12
13

// Parse HTTP JSON bodies

14

app.use(bodyParser.json());

15

// Parse URL-encoded params

16

app.use(bodyParser.urlencoded({ extended: true }));

17

// Register hooks module

18

app.configure(hooks());

19

// Add REST API support

20

app.configure(rest());

21

// Configure Socket.io real-time APIs

22

app.configure(socketio());

23

// Register our authentication plugin

24

app.configure(authentication({ idField: 'id' }));

25

// Register our memory "users" service

26

app.use('/users', memory());

27

// Register a nicer error handler than the default Express one

28

app.use(handler());

29
30

// Register a before hook to hash passwords

31

app.service('users').before({

32
33

create: authentication.hooks.hashPassword()
});

34
35

// Create a test user

36

app.service('users').create({

37
38
39

email: 'admin@feathersjs.com',
password: 'admin'
});

40
41

// Start the server

42

app.listen(3030);

13/4/2016

feathersjs.com

SeewhatmakesFeatherssospecial

Modern,solid,and100%JavaScript
Built using promises and ES6 features, Feathers is a tiny, fully compatible wrapper over Express
(http://expressjs.com) and Socket.io (http://socket.io), both of which have been used in production by
thousands of companies.

Universal
Feathers can be used in the browser, React Native and server side with NodeJS. Using the Feathers client
(http://docs.feathersjs.com/clients/feathers.html) you can quickly add authentication, share code
between your server and client, and easily make your apps real-time.

FrameworkFriendly
Feathers easily integrates with any client side framework. It plays especially well with React and React
Native. Theyre practically BFFs.

ServiceOriented
Feathers gives you the structure to build service oriented apps from day one. When you eventually need to
split up your app into microservices its an easy transition and your Feathers apps can scale painlessly.

InstantRealtimeRESTAPIs
Feathers provides instant CRUD functionality via Services
(http://docs.feathersjs.com/services/readme.html), exposing both a RESTful and real-time API
automatically through Socket.io or Primus.

DatastoreAgnostic
Feathers has adapters for 15+ data sources (http://docs.feathersjs.com/databases/readme.html) out of
the box, including MongoDB, Postgres and S3. You can have multiple datastores in a single app and swap

13/4/2016

feathersjs.com
them out painlessly due to our consistent query interface
(http://docs.feathersjs.com/databases/querying.html).

FlexiblePlugins
Feathers is a batteries included but easily swappable framework. We have entirely optional plugins that
provide authentication (https://github.com/feathersjs/feathers-authentication) and SMS
(https://github.com/feathersjs/feathers-twilio) or email (https://github.com/feathersjs/feathers-mailer)
messaging out of the box. Include exactly what you need. No more, no less.

CreateyourfirstFeathersapptoday!
Get Started (http://docs.feathersjs.com)

ABOUT

LEARN

SUPPORT

Philosophy
Documentation
Training
(http://docs.feathersjs.com/why/philosophy.html)
(http://docs.feathersjs.com)
(mailto:hello@feathersjs.com)
Team
Examples
Hire Us
(https://github.com/feathersjs/feathers/graphs/contributors)
(https://github.com/feathersjs/feathers(mailto:hello@feathersjs.com)
Roadmap
demos)
Github Issues
(https://trello.com/b/ZYZVlAqe/feathersGuides
(https://github.com/feathersjs/feathers/issues)
roadmap)
(http://docs.feathersjs.com/guides/readme.html)
Slack (http://slack.feathersjs.com)
Blog (https://blog.feathersjs.com)
FAQ
(http://docs.feathersjs.com/help/faq.html)

(https://twitter.com/feathersjs) (https://github.com/feathersjs)
(http://slack.feathersjs.com/) (https://blog.feathersjs.com/)

13/4/2016

feathersjs.com
(http://slack.feathersjs.com/) (https://blog.feathersjs.com/)
(http://stackoverow.com/questions/tagged/feathersjs)

(/)
2014-2016 Feathers contributors (https://github.com/orgs/feathersjs/people)