1.0.1 • Published 4 years ago
fastify-got v1.0.1
fastify-got
Simple plugin to work with Got within Fastify. Supports all features from got.
Install
npm i fastify-got
Usage
const fastify = require('fastify')();
fastify.register(require('fastify-got'));
(async () => {
try {
const response = await fastify.got('https://sindresorhus.com');
console.log(response.body);
//=> '<!doctype html> ...'
} catch (error) {
console.log(error.response.body);
//=> 'Internal server error ...'
}
})();
License
Licensed under MIT.