Giter Site home page Giter Site logo

rxpressive's Introduction

Rxpressive

Express meets RxJS. Let's start reactive server with tyrannosaurus!

Installation

$ npm install rxpressive

Warning

THIS PACKAGE IS NOW UNDER DEVELOPMENT. APIs are not completed and subject to change.

Basically, this framework uses server framework Express and reactive library RxJS. If you are not familiar with those framework/library, I recommend you to read documents about them first.

Example

Hello World!

For ES6 user (or for babel user)

const rxpressive = require('rxpressive');
const app = rxpressive();

app.get('/').subscribe(({ req, res }) => {
  res.send('Hello World!');
});

app.listen(3000).subscribe(() => {});

For ES5 or lesser version user

var rxpressive = require('rxpressive');
var app = rxpressive();

app.get('/').subscribe(function(rxpressive) {
  rxpressive.res.send('Hello World!');
});

app.listen(3000).subscribe(function () {});

Available APIs

  • All http verbs supported by express. There are few examples on following.

    • GET
    var rxpressive = require('rxpressive');
    var app = rxpressive();
    
    app.get('/').subscribe(function(rxpressive) {
      rxpressive.res.send('Hello World!');
    });
    
    app.listen(3000).subscribe(() => {});
    • POST with application/x-www-form-urlencoded data
    var rxpressive = require('rxpressive');
    var bodyParser = require('body-parser');
    var app = rxpressive();
    
    app.use(bodyParser.urlencoded({ extended: false }))
      .subscribe(function(rxpressive) { rxpressive.next(); });
    
    app.post('/').subscribe(function(rxpressive) {
      console.log(rxpressive.req.body);
      rxpressive.res.send('posted');
    });

rxpressive's People

Contributors

ailrun avatar snyk-bot avatar

Stargazers

Jesus Franco avatar Lars avatar Andrejs Agejevs avatar Tadas Šubonis avatar Alexander Mills avatar Patrick Michalina avatar James Young avatar Salvador Guzman avatar Jan Kuri avatar

Watchers

James Young avatar James Cloos avatar  avatar  avatar

Forkers

w3ss tzkmx

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.