https://github.com/ringo/stick
JSGI middleware composition layer and application framework
https://github.com/ringo/stick
javascript middleware ringojs stick webframework
Last synced: 7 months ago
JSON representation
JSGI middleware composition layer and application framework
- Host: GitHub
- URL: https://github.com/ringo/stick
- Owner: ringo
- License: other
- Created: 2010-11-10T23:09:48.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2021-12-08T19:12:12.000Z (about 4 years ago)
- Last Synced: 2025-05-01T15:39:59.759Z (9 months ago)
- Topics: javascript, middleware, ringojs, stick, webframework
- Language: JavaScript
- Homepage:
- Size: 637 KB
- Stars: 47
- Watchers: 8
- Forks: 17
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stick
Stick is an extensible HTTP server framework for [RingoJS](http://ringojs.org/) to create modular web applications
composed out of "plugins" (also known as "JSGI middleware functions").
## Overview
Compose web applications out of plugins:
var {Application} = require("stick");
var app = exports.app = Application();
app.configure("notfound", "error", "static", "params", "mount");
app.static(module.resolve("htdocs"));
app.mount("/", require("./views"));
Currently Stick comes with the following middleware modules:
* accept - HTTP content negotiation helper
* basicauth - basic HTTP authentication
* cookies - read HTTP cookies
* cors - Cross-site HTTP requests access control
* csrf - CSRF mitigation
* error - generating error pages
* etag - ETag based conditional GET
* gzip - GZip content encoding
* locale - Discover the locale from various possible sources
* method - HTTP method overriding
* mount - mounting other applications
* notfound - generating 404 pages
* params - form data parsing
* profiler - JavaScript profiling
* render - mustache.js templates (use `rp install ringo-mustache`)
* requestlog - collecting per-request log messages
* route - Sinatra-like request routing
* session - session support
* static - serving static files
* upload - handling file uploads
Stick provides an `Application` object that can be used to compose web
applications out of JSGI middleware components. Middleware can in turn
define methods or properties on the application object to make itself
configurable to the outside world.
Check out the demo applications and documentation to learn more.
## Running
Use the ringo package manager to install Stick:
$ rp install stick
To start the stick demo application run the `ringo` command with the
`demo.js` script in the stick directory:
$ ringo examples/demo.js
Then point your browser to .
## License
Stick is distributed under the MIT license.