Commit graph

775 commits

Author SHA1 Message Date
Sonny Piers
b7a747fc71 Fix typo in request api documentation. 2014-04-12 00:29:33 +02:00
Jonathan Ong
58faefa343 Merge pull request #257 from sonnyp/patch-1
Typo in documentation
2014-04-11 15:24:29 -07:00
Sonny Piers
d92a3c371f Update index.md 2014-04-12 00:23:11 +02:00
TJ Holowaychuk
8a50594858 Merge pull request #256 from dead-horse/refactor-status-and-body
refactor res.status= and res.body=
2014-04-11 10:42:19 -07:00
dead_horse
64aad129d3 fix this.status= in this.body
fix default status set bug in this.body=null.
do not call this.status= if this.status exist.
make sure empty content status remove content headers
2014-04-10 11:47:30 +08:00
TJ Holowaychuk
c15cf47475 Release 0.5.3 2014-04-09 09:42:23 -07:00
TJ Holowaychuk
0174efa8ed Merge branch 'master' of ssh://github.com/koajs/koa 2014-04-09 09:34:56 -07:00
TJ Holowaychuk
3d8ab61fa1 change res.type= to always default charset. Closes #252 2014-04-09 09:34:50 -07:00
dead_horse
329d2b94db make sure all intermediate stream bodies will be destroy and have error handle 2014-04-10 00:02:13 +08:00
TJ Holowaychuk
681b4afc6e Merge pull request #251 from matheusazzi/patch-1
Use SVG Badge
2014-04-06 08:44:47 -07:00
Matheus Azzi
edb7bb1dd1 Use SVG Badge 2014-04-06 11:53:08 -03:00
TJ Holowaychuk
dfe8e95be4 remove ctx.inspect() implementation. Closes #164
obscures user-defned properties. ideally we fix it so .req / .res are not so verbose but meh for now
2014-04-05 19:15:14 -07:00
Jonathan Ong
d8b6a18c9d Merge pull request #244 from t3chnoboy/master
ocd
2014-03-24 11:23:54 -07:00
Dmitry Mazuro
9e8d6a3aa0 ocd 2014-03-24 21:21:15 +03:00
Jonathan Ong
d6c523d107 0.5.2 2014-03-23 04:03:34 -07:00
Jonathan Ong
ee8345303a remove unnecessary index.js file 2014-03-23 04:03:17 -07:00
Jonathan Ong
184cb0b3d9 bump dev deps 2014-03-23 04:02:05 -07:00
Jonathan Ong
52cb57cc7e fix overwriting of content-type w/ HEAD requests 2014-03-23 04:01:14 -07:00
Jonathan Ong
a18ee8143d update SLOC count
sloc lib/

---------- result ------------

      physical lines :  1456
lines of source code :  542
       total comment :  700
          singleline :  35
           multiline :  665
               empty :  214

number of files read :  4

------------------------------
2014-03-12 18:40:21 -07:00
Jonathan Ong
59ea8faabb History.md++ 2014-03-12 18:32:23 -07:00
Jonathan Ong
c382305d4f refactor: use escape-html
dat SLOC
2014-03-12 18:30:16 -07:00
Jonathan Ong
182f9d6fa4 refactor: use statuses 2014-03-12 18:29:14 -07:00
TJ Holowaychuk
9b1651a8e6 fix inspection of app. Closes #108 2014-03-11 11:06:57 -07:00
TJ Holowaychuk
895cf4040c add app.toJSON() 2014-03-11 11:01:33 -07:00
TJ Holowaychuk
f0e353d6a0 fix some tests that never worked 2014-03-11 10:50:34 -07:00
Jonathan Ong
9c2ea5a2a8 Update koa-vs-express.md 2014-03-10 04:20:54 -07:00
Jonathan Ong
b03fef3ac4 Merge pull request #236 from phillipalexander/patch-1
Fix broken reddit community link
2014-03-09 14:00:09 -07:00
Phillip Alexander
4d1b52ea40 Fix broken reddit community link
Add required protocol to link
2014-03-09 12:23:40 -07:00
TJ Holowaychuk
f916c45539 Merge pull request #235 from gdi2290/patch-1
add subreddit to Community list
2014-03-09 10:16:31 -07:00
PatrickJS
83be927816 add subreddit to Community list 2014-03-08 22:21:32 -08:00
Jonathan Ong
5c0c898510 Merge pull request #233 from alsotang/patch-1
Update context.md
2014-03-08 12:58:19 -08:00
alsotang
bef5bad738 Update context.md
ctx.type is delegated to this.response.
2014-03-08 14:19:40 +08:00
TJ Holowaychuk
0f20b85da5 fix some typos in koa-vs-express docs 2014-03-07 14:11:02 -08:00
Jonathan Ong
3cb6c07d5c Merge pull request #232 from altruism/master
Let errors provide their own status.
2014-03-06 20:08:00 -08:00
New Now Nohow
0a223f2bb7 Let errors provide their own status.
When calling `ctx.throw`, you're allowed to provide an error object and a
status code. The status code is later set as the `status` property of the error
object. If no status code is provided, it defaults to 500. However, this
happens even if the error object already had a `status` property.

This commit allows an error's pre-existing `status` property to be used in
conjunction with `ctx.throw`.

If the status code is below 500, the error message will be exposed to the user
in the HTTP response. It would be nice to have some Error subclasses that
always have the same status code, because then we could just write
`ctx.throw(new WhateverError())`, and define which 4xx error code we want in
the definition of `WhateverError` itself. If, for example, an
`AuthenticationError` is always meant to go along with a 401, then it would be
nice to just have that knowledge in the class definition.
2014-03-06 22:54:25 -05:00
TJ Holowaychuk
c96459bc61 Release 0.5.1 2014-03-06 18:06:32 -08:00
TJ Holowaychuk
b1f0abd16d Revert "add response.charset accessor and ctx.charset alias"
This reverts commit 94413b1bd4.
2014-03-06 18:05:01 -08:00
TJ Holowaychuk
c50012a636 Merge pull request #225 from dead-horse/issue224-host-confused
add request.hostname(getter), fixed #224
2014-02-26 10:54:40 -08:00
Jonathan Ong
d85b7577e9 Merge pull request #226 from slaskis/patch-1
debug name koa:context -> koa:request
2014-02-26 01:33:44 -08:00
Robert Sköld
e77e5a4bdc Debug name koa:context -> koa:request 2014-02-26 09:51:45 +01:00
dead_horse
72a9b69146 add request.hostname(getter), fixed #224
make request.host and request.hostname work as node url lib
http://nodejs.org/api/url.html#url_url
this commit will change older request.host(getter)
2014-02-26 14:03:05 +08:00
TJ Holowaychuk
e8d3a37e9e bump 2014-02-19 20:58:28 -08:00
TJ Holowaychuk
eaba2040d1 Release 0.5.0 2014-02-19 20:55:29 -08:00
TJ Holowaychuk
b15cd30b01 remove benchmarks from readme 2014-02-19 20:51:34 -08:00
TJ Holowaychuk
7bbcd2dfcc remove gnode recommentation (too slow) 2014-02-19 20:50:35 -08:00
Jonathan Ong
cb532b7bef this.writable to check if the socket is writable
because node sucks haha
2014-02-15 02:06:08 -08:00
TJ Holowaychuk
e56f442222 refactor request docs to use this.request
maybe we should do this with all of them, but then we might
need a section showing ctx.* stuff, people might miss the aliasing all together
2014-02-14 09:40:58 -08:00
TJ Holowaychuk
785aba879c add request.charset 2014-02-14 09:38:59 -08:00
TJ Holowaychuk
94413b1bd4 add response.charset accessor and ctx.charset alias 2014-02-14 09:33:10 -08:00
TJ Holowaychuk
c0e0c7c6aa update docs for previous breaking change 2014-02-14 09:20:29 -08:00