Skip to content

Instantly share code, notes, and snippets.

@WesTyler
Last active November 9, 2017 14:58
Show Gist options
  • Save WesTyler/7a44cfd1c509e979432d235527c23ec9 to your computer and use it in GitHub Desktop.
Save WesTyler/7a44cfd1c509e979432d235527c23ec9 to your computer and use it in GitHub Desktop.
const plugin = {
register: async (server, options) => {
// Do your registration stuff
},
name: 'pluginName',
version: '1.0.1',
once: true,
options: {}
};
try {
await server.register(plugin);
}
catch (err) {
console.log('Deal with your registration error.');
}
@illustratordavid
Copy link

illustratordavid commented Nov 9, 2017

Unfortunately... I'm getting an error "SyntaxError: await is only valid in async function" with this code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment