Skip to content

Instantly share code, notes, and snippets.

@israeleriston
Created September 5, 2017 06:43
Show Gist options
  • Save israeleriston/3c77593c6c1a125ad1481b646643971d to your computer and use it in GitHub Desktop.
Save israeleriston/3c77593c6c1a125ad1481b646643971d to your computer and use it in GitHub Desktop.
Importação node
// ref /src/plugins/index.js
const router = require('./router')
const cors = require('./cors')
console.log(' ta vindo aqui os plugisn ? ' + JSON.stringify(router))
const plugins = [ router, cors ]
module.exports = plugins
// ref /src/config/server.js
// os plugins sempre vem undefined, what?
const hapi = require('hapi')
const registerPlugins = require('../helps/register/plugins')
const plugins = require('../plugins/index')
const server = new hapi.Server()
server.connection({ port: 8080, host: 'localhost' })
console.log(' plugins no server ' + JSON.stringify(plugins))
registerPlugins(server, plugins)
module.exports = server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment