Giter VIP home page Giter VIP logo

rill's Introduction

Rill

Expressive HTTP middleware for node.js and the browser. Rill brings cascading middleware to the browser and enables truly isomorphic web applications. It makes apps enjoyable to write with a simpler top down mental model of your app and free progressive enhancement.

Rill provides the minimum for abstractions over node and the browser enabling things like routing (with redirecting, refreshes and more), cookies, and middleware with the same api.

Installation

Npm

npm install rill

Bower

bower install rill

Community

Example

/**
 * The following code can run 100% in the browser or in node js.
 * Examples use es6/7 with Babel but this is optional.
 */

const Rill = require("rill");
const app  = Rill();

// Logger

app.use(async ({ req }, next)=> {
	const start = new Date;

	// Rill uses promises for control flow.
	// ES2016 async functions work great as well!
	await next();

	const ms = new Date - start;
	console.log(`${req.method} ${req.url} - ${ms}`);
});

// Response

app.use(({ res })=> {
	// Here we render a string,
	// check out middleware such as @rill/react
	// for isomorphic dom rendering.
	res.body = "Hello World";
});

app.listen(3000);

Contributions

  • Use gulp to run tests.

Please feel free to create a PR!

rill's People

Contributors

dylanpiercey avatar

Watchers

 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.