doc: Change usage of reserved word static
in guide (#829)
Very minor, but I think `static` is a reserved word so it might be better to use `serve` instead, I think that's what `koa-static` uses in its examples as well.
This commit is contained in:
parent
a293cc2d5e
commit
c62aa90e6e
1 changed files with 5 additions and 5 deletions
|
@ -256,16 +256,16 @@ $ DEBUG=koa* node --harmony examples/simple
|
||||||
|
|
||||||
```js
|
```js
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var static = require('koa-static');
|
var serve = require('koa-static');
|
||||||
|
|
||||||
var publicFiles = static(path.join(__dirname, 'public'));
|
var publicFiles = serve(path.join(__dirname, 'public'));
|
||||||
publicFiles._name = 'static /public';
|
publicFiles._name = 'serve /public';
|
||||||
|
|
||||||
app.use(publicFiles);
|
app.use(publicFiles);
|
||||||
```
|
```
|
||||||
|
|
||||||
Now, instead of just seeing "static" when debugging, you will see:
|
Now, instead of just seeing "serve" when debugging, you will see:
|
||||||
|
|
||||||
```
|
```
|
||||||
koa:application use static /public +0ms
|
koa:application use serve /public +0ms
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue