Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steadicat/busboy
A microframework for JSON REST APIs, based on Node.js and CoffeeScript.
https://github.com/steadicat/busboy
Last synced: 8 days ago
JSON representation
A microframework for JSON REST APIs, based on Node.js and CoffeeScript.
- Host: GitHub
- URL: https://github.com/steadicat/busboy
- Owner: steadicat
- Created: 2010-03-24T15:57:41.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-09-23T18:50:05.000Z (about 14 years ago)
- Last Synced: 2023-04-21T17:13:21.701Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 286 KB
- Stars: 17
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Busboy
A microframework built on top of Node.js and CoffeeScript designed specifically for RESTful JSON APIs. Very early stages.
# Example
busboy: require('./index')
process.mixin(busboy.methods) # GET, POST, PUT, DELETE
process.mixin(busboy.logging) # DEBUG, INFO, WARN, ERRORGET '/', () ->
@respond { ok: true }GET '/post/*', (id) ->
@respond { ok: true, message: "I can tell you are looking for post $id." }POST '/post/', (args) ->
DEBUG "Received args", args
if args? and args.text?
@respond { ok: true, message: "Thank you for posting '$args.text'!" }
else
@error 'bad_request', 'You have to post a text.', 400GET '/headers', (id) ->
@respond { headers: @request.headers }process.mixin(busboy.utils) # memoize, client...
getCloudantMember: memoize (id) ->
client.get("http://cloudant.cloudant.com/team/$id")GET '/cloudant_member/*', (id) ->
success: (data) => @respond data
getCloudantMember(id) success, @errorbusboy.start(8888)