@hapi/scooter v7.0.0
console
npm install @hapi/scooter@7.0.0console
yarn add @hapi/scooter@7.0.0console
pnpm add @hapi/scooter@7.0.0User-agent information plugin.
Compatibility
| Major version | License | Node.js |
|---|---|---|
| 8 | BSD | >= 16 |
| 7 | BSD | >= 16 |
Scooter uses the [useragent] package to provide user-agent information. For more details of what information scooter provides, please see the useragent.
Usage
javascript
const Hapi = require('@hapi/hapi');
const Scooter = require('@hapi/scooter');
const start = async () => {
const server = new Hapi.Server();
server.route({
method: 'GET',
path: '/user-agent',
handler: (request, h) => {
return request.plugins.scooter;
},
});
await server.register(Scooter);
await server.start();
console.log(server.info.uri + '/user-agent');
};
start();