Created
July 26, 2019 01:13
-
-
Save RafaelGSS/e951398544cf06e8538774d546d091c1 to your computer and use it in GitHub Desktop.
Index Example Fastify Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fastify = require('fastify')() | |
fastify.decorate('configuration', { | |
db: 'alguma-database', | |
port: 800 | |
}) | |
//Plugin1 | |
fastify.register(require('./plugin1.js')) | |
//Plugin2 | |
fastify.register(require('./plugin2.js')) | |
fastify.listen(3000, function (err, address) { | |
if (err) throw err | |
fastify.log.info(`Servidor iniciado: ${address}`) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment