Files
DefinitelyTyped/types/yar/yar-tests.ts
2018-02-17 21:22:06 +01:00

25 lines
534 B
TypeScript

import { Server, Request } from 'hapi';
import * as yar from 'yar';
async function boot() {
const server = new Server();
await server.register({
plugin: yar,
options: {
cookieOptions: {
password: 'test',
isSecure: true,
},
},
});
server.route({
path: '/test',
method: 'get',
handler(request: Request) {
const example = request.yar.get('example');
return example.key;
},
});
}