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 webManifest = { | |
server: { | |
cache: 'redis', | |
port: 8000 | |
}, | |
register: { | |
plugins: [ | |
'./ui-user', | |
{ plugin: './assets', options: { uglify: true } }, | |
{ plugin: require('./awesome-plugin'), options: { whyNot: true } } |
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 manifest = { | |
server: { | |
cache: 'redis' | |
}, | |
connections: [ | |
{ | |
port: 8000, | |
labels: ['web'] | |
}, | |
{ |
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
{ | |
register: { | |
plugins: [ | |
'myPlugin', | |
{ plugin: 'plugin2', once: true, options: { apiHost: 'example.com' } }, | |
{ plugin: require('finalPlugin'), routes: { prefix: '/test/' } } | |
] | |
} | |
} |
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
{ | |
register: { | |
plugins: [ | |
'myPlugin', | |
{ plugin: 'plugin2' }, | |
{ plugin: require('finalPlugin') } | |
] | |
} | |
} |
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 plugin = { | |
register: async (server, options) => { | |
// Do your registration stuff | |
}, | |
name: 'pluginName', | |
version: '1.0.1', | |
once: true, | |
options: {} | |
}; | |
try { |
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 register = (server, options, next) => { | |
// Do your registration stuff | |
return next(); | |
}; | |
register.attributes = { | |
name: 'pluginName', | |
version: '1.0.1' | |
}; | |
const plugin = { | |
register, |
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
await webServer.register(plugin1); | |
await adminServer.register(plugin2); |
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
server.register({ register, select: ['web'] }, () => {}); | |
// OR | |
server.register({ register }, { select: ['web'] }, () => {}); |
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 register = async (server, options) => { | |
// Do your registration stuff | |
}; | |
const plugin = { | |
register, | |
name: 'pluginName', | |
version: '1.0.1' | |
}; | |
try { | |
await server.register(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 register = (server, options, next) => { | |
// Do your registration stuff | |
return next(); | |
}; | |
register.attributes = { | |
name: 'pluginName', | |
version: '1.0.1' | |
}; | |
server.register({ register }, () => {}); |
NewerOlder