Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server.route({
- method: 'GET',
- path: '/cookies/set',
- config: {
- handler: (request: hapi.Request, reply: hapi.IReply) => {
- reply('cookie set').state('data', JSON.stringify({
- hasCookie: true
- }));
- }
- }
- });
- server.route({
- method: 'GET',
- path: '/cookies/get',
- config: {
- state: {
- parse: true,
- failAction: 'error'
- },
- handler: (request: hapi.Request, reply: hapi.IReply) => {
- reply({
- cookie: request.state
- })
- }
- }
- });
Add Comment
Please, Sign In to add comment