• Stars
    star
    523
  • Rank 82,924 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 10 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A web framework based purely on require('http')

http-framework

A web framework based purely on require('http')

Table of Contents generated with DocToc

Motivation

require('http') is a web framework. All you need are a few small modules that do one thing well when you are building your web application route handlers.

This module aggregates and documents (with examples) a selection of small modules that can be used to achieve this goal.

It's recommended you check out the:

I do not recommend you use this "framework". You should check out the small modules and use them directly. Use the list of examples here for inspiration.

http-framework is an OPEN Open Source Project, see the Contributing section to find out what this means.

Modules

Check out the modules folder for an example of small modules you can combine to build your own custom "framework"

See the package.json dependencies hash for an example of many small modules used in the examples folder of this project.

For a complete list of Modules check out the wiki

Documentation

HTTP workshop

For a tutorial / workshop see http-works

module docs

rest of the modules

// TODO

For now see the examples folder

Examples

express inspired examples

These examples are clones of express examples demonstrating how to author web apps without frameworks.

  • auth An example demonstrating how to login and authenticate users
  • auth-helpers An example demonstrating how you can restrict certain routes in your apps to only be accessed by certain types of users
  • content-negotiation An example demonstrating how you can return different types of content based on what the user asks for in his Accept header.
  • cookie-sessions An example of storing session information in a users cookie
  • cookies An example of setting a cookie to track a user
  • cors An example of adding cors support to your HTTP server
  • downloads An example of allowing users to download files from your server
  • error An example of handling errors in your HTTP server
  • error-pages An example of rendering custom 500 and 404 pages in your web server
  • expose-data-to-client An example of putting server side state into your template so that it can be accessed from browser javascript
  • hello-world A simple hello world example
  • multipart An example demonstrating file uploads and saving them to disk temporarily.
  • mvc An over engineered example of how to structure a slightly larger web application. Includes configuration, modularity and databases. Take ideas from it, please do not copy paste it
  • online An example of using redis and the online module to track user presence
  • route-map An example of a map utility function that can be used to structure your routes differently. This demonstrates you can do whatever you want, if you like it, do it.
  • route-seperation An example of spreading your route handlers over multiple files.
  • search An example of doing a database query over XHR with a web server backed by redis
  • session An example of storing information in a session. The session is either backed by redis or memory.
  • static-files An example of serving static files for your web server
  • vhost An example of handling multiple sub domains as seperate applications in a singlue web server
  • web-service An example JSON REST api web server. Contains API key authentication and error handling

Credit for the applications goes to

  • @tj & express maintainers

hapi inspired examples

These examples are clones of hapi examples demonstrating how to author web apps without frameworks.

  • tail An example of handling async errors in your applications after you have ended the HTTP response
  • validate-api An example of how to add validation logic to your HTTP route handlers. Both validating query params & the HTTP body

Credit for the application's goes to

  • @hapijs & hapi maintainers

connect inspired examples

These examples are clones of connect examples demonstrating how to author web apps without frameworks.

  • basic-auth An example of handling basic authorization style authentication of a web server.
  • csrf An example of adding csrf security to a form in a web application

Credit for the applications goes to

  • @tj & connect maintainers

Todo

  • Finish porting express examples
  • continue porting hapi examples
  • continue connect examples
  • Port koajs examples
  • Port restify examples
  • Port partial.js examples
  • Finish documentation
  • Get community feedback
  • Author new fresh examples

Installation

npm install http-framework

Contributors

  • Raynos
  • Matt-Esch
  • maxogden

MIT Licenced

More Repositories

1

mercury

A truly modular frontend framework
JavaScript
2,822
star
2

xtend

extend like a boss
JavaScript
305
star
3

global

Require global variables
JavaScript
252
star
4

main-loop

A rendering loop for diffable UIs
JavaScript
172
star
5

leaked-handles

Detect any handles leaked in node
JavaScript
166
star
6

DOM-shim

Shims out the entire DOM4 API
JavaScript
154
star
7

function-bind

JavaScript
136
star
8

error

Error handling utilities for node
JavaScript
123
star
9

body

Body parsing
JavaScript
120
star
10

after

All the flow control you'll ever need
JavaScript
116
star
11

min-document

A minimal DOM implementation
JavaScript
108
star
12

jsig

From scratch type-checker
JavaScript
104
star
13

duplexer

Creates a duplex stream
JavaScript
95
star
14

observ

A observable value representation
JavaScript
74
star
15

observ-struct

An object with observable key value pairs
JavaScript
72
star
16

virtual-hyperscript

A DSL for creating virtual trees
JavaScript
60
star
17

dom-delegator

Decorate elements with delegated events
JavaScript
58
star
18

topology

Different network topologies
JavaScript
57
star
19

continuable

Idea for callbacks as values
JavaScript
54
star
20

live-reload

A live reload server & client
JavaScript
51
star
21

pd

Property Descriptors made easy
JavaScript
44
star
22

engine.io-stream

Wrap engine.io in a real stream interface
JavaScript
44
star
23

vdom-thunk

A thunk optimization for virtual-dom
JavaScript
42
star
24

stream-chat

Alpha chat app using streams for communication
JavaScript
40
star
25

resultify

Handle errors with async/await without try/catch.
JavaScript
38
star
26

graphics

Efficient data structures that represent renderable scenes
JavaScript
38
star
27

safe-json-parse

Parse JSON safely without throwing
JavaScript
36
star
28

webrtc-stream

WebRTC demo
JavaScript
34
star
29

level-livefeed

Live query a range in leveldb
JavaScript
34
star
30

http-works

A workshopper for http framework
JavaScript
32
star
31

tsdocstandard

Standard but also use TypeScript on JS files with jsdoc.
JavaScript
31
star
32

discovery-network

A peer to peer discovery network
JavaScript
31
star
33

geval

JavaScript
30
star
34

corsify

CORS up a route handler
JavaScript
29
star
35

itape

An interactive tape runner.
JavaScript
27
star
36

send-data

send data through response
JavaScript
26
star
37

ncore

Core infrastructure for node.
JavaScript
26
star
38

observ-array

An array containing observable values
JavaScript
26
star
39

append-only

Append only scuttlebutt structure
JavaScript
25
star
40

jsonml-stringify

Convert jsonml arrays to html strings
JavaScript
22
star
41

eslint-plugin-perf-standard

A set of custom plugins to enforce high performance JS
JavaScript
21
star
42

routes-router

Simplest request handler possible
JavaScript
21
star
43

for-each

A better forEach
JavaScript
21
star
44

auth-stream

Authorize access before exposing a stream
JavaScript
21
star
45

value-event

Create DOM event handlers that write to listeners
JavaScript
21
star
46

boot

Shoe & mux demux with reconnect!
JavaScript
20
star
47

stream-router

Easily route mdm streams
JavaScript
19
star
48

jsconf2014-talk

Modular frontend with NPM & pals
JavaScript
19
star
49

raynos-blog

My blog
JavaScript
19
star
50

whatwg-streams

JavaScript
17
star
51

deep-merge

Deep merge objects with custom merging logic
JavaScript
17
star
52

map-async

Asynchronously map over a list
JavaScript
17
star
53

data-channel

Turn a data channel into a stream
JavaScript
17
star
54

gens

Experimental usage of generators
JavaScript
17
star
55

level-cache

An in memory cache on top of leveldb
JavaScript
17
star
56

npm-bin-deps

NPR allows you to run your CLI dependencies without having a copy in node_modules.
JavaScript
16
star
57

serve-browserify

HTTP handler for serving browserify bundles
JavaScript
16
star
58

delta-stream

A stream that emits deltas in change
JavaScript
15
star
59

examplifier

Turn bland source code into interactive demos
JavaScript
15
star
60

distributed-map

A distributed key value store in the browser
JavaScript
14
star
61

clientmongo

Use the mongo API in the browser
JavaScript
14
star
62

multi-channel-mdm

Create persisted channels to broadcast data!
JavaScript
14
star
63

buffer-stream

A duplex stream that buffers writes
JavaScript
14
star
64

chain-stream

Chain stream operations together
JavaScript
14
star
65

fake-s3

a fake s3 server for testing purposes.
JavaScript
13
star
66

signal-channel

A signal channel that empowers webrtc
JavaScript
13
star
67

levelidb

A levelup interface on top of indexeddb
JavaScript
12
star
68

level-write-stream

A writeStream implementation for leveldb
JavaScript
12
star
69

frontend-framework

Building frontend apps with small modules
JavaScript
12
star
70

reduce

A better [].reduce
JavaScript
12
star
71

browserify-server

spin up browserify demos real easy
JavaScript
12
star
72

format-stack

Formats a stack with colors
JavaScript
12
star
73

feature

Feature detection for host objects
JavaScript
12
star
74

hash-router

A frontend router for the hash change event
JavaScript
11
star
75

html-delegator

Decorate elements with delegated events
JavaScript
11
star
76

promise-stream

A Promises/A implementation based on streams
JavaScript
11
star
77

ready-signal

A ready signal. Wait for ready and signal it's ready
JavaScript
11
star
78

ev-store

Stores event listeners and event handles on a DOM object
JavaScript
11
star
79

weakmap-shim

JavaScript
10
star
80

to-array

Turn an array like into an array
JavaScript
10
star
81

term-color

A lighter weight alternative to chalk
JavaScript
9
star
82

static-config

JavaScript
9
star
83

npm-less

JavaScript
9
star
84

eventemitter-light

It's a light event emitter
JavaScript
9
star
85

expiry-model

A scuttlebutt model that expires keys
JavaScript
9
star
86

http-methods

Handle multiple methods elegantly
JavaScript
9
star
87

mux-demux-shoe

Shoe and mux-demux come together!
JavaScript
9
star
88

validate-form

JavaScript
9
star
89

iterators

iterate over collections asynchronously
JavaScript
8
star
90

fake-sqs

Runs a fake SQS server on a HTTP port.
JavaScript
8
star
91

redirecter

JavaScript
8
star
92

seaport-proxy

Proxy all the seaports!
JavaScript
8
star
93

request-proxy

A version of request that's local to a fixed base uri
JavaScript
8
star
94

pre-bundled

A tool that pre bundles and re publishes npm dependencies
JavaScript
8
star
95

mongo-col

mongodb collection wrapper
JavaScript
8
star
96

tape-harness

A helper to run integration tests against an application
JavaScript
8
star
97

sockjs-stream

A streaming API for sockjs
JavaScript
7
star
98

so642

JavaScript
7
star
99

add

Add two numbers
JavaScript
7
star
100

composite

Compose functions together
JavaScript
7
star