1.0.11 • Published 8 years ago

hapi-es7-async-handler v1.0.11

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

hapi-es7-async-handler

async handler support for hapijs apps

npm version

You can use this plugin to add async handler function to your hapi projects.

requiements

You need es7 supported javascript development environment or use Typescript

Usage

Example:

const server = new Hapi.server()

const plugins = [
  ...
  {
    register: require('hapi-es7-async-handler'),
  },
  ...
];

server.register(plugins, (err) => {
  ...
})
server.route({
  path: '/',
  method: 'get',
  handler: async (request, reply) => {
    ...
    const result = await yourAsyncJob(); // the async job might be returning Promise object
    reply(result);
  }
});
1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago