Mattress
Mattress is a small framework, a foundation if you will, on top of which you can build APIs – Mattress is not a web framework, it is an API framework. It was and is based on restify and borrows heavily from it, but differs in some aspects. Despite it's name, Mattress will not automatically create REST APIs for you. Whether or not your API is actually RESTful depends on you.
Got ideas and/or feature requests? Please file an issue.
Things Mattress does
a.k.a features!
- Content negoitation
- HTTP and HTTPS
- HTTP Basic Authentication
- Versioned routes
Quick start
A server that simply echos "Hello world." (available as examples/hello-world.js):
"use strict"; var Mattress = ; var v1 = "GET": { response; response; }; var media = "text/plain": "1": v1 ; Mattress;
Running:
$ curl -i localhost:8888/hello -H "Accept: text/plain; v = 1"
Will output:
HTTP/1.1 200 OK
Content-Type: text/plain; version = 1; charset = utf-8
Date: Tue, 18 Feb 2014 03:07:07 GMT
Connection: keep-alive
Transfer-Encoding: chunked
Hello world.
Running tests
$ grunt test
License
This software is released under the ISC License. See LICENSE.md for more information.