Skip to content

Commit

Permalink
update example --code 🥡 ..
Browse files Browse the repository at this point in the history
  • Loading branch information
3imed-jaberi committed Sep 9, 2020
1 parent be504ad commit 7cc32cc
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions example.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@

'use strict';
'use strict'

const conditional = require('./');
const etag = require('koa-etag');
const Koa = require('koa');
const app = new Koa();
const conditional = require('.')
const etag = require('koa-etag')
const Koa = require('koa')
const app = new Koa()

// use it upstream from etag so
// that they are present

app.use(conditional());
app.use(conditional())

// add etags

app.use(etag());
app.use(etag())

// respond

app.use((ctx, next) => {
return next().then(() => {
ctx.body = {
name: 'tobi',
species: 'ferret',
age: 2
};
});
}
})
})

app.listen(3000);

console.log('listening on port 3000');
app.listen(
3000,
console.log('listening on port 3000')
)

0 comments on commit 7cc32cc

Please sign in to comment.