Optional callback is different definition + writing tests

This commit is contained in:
Jean-Philipe Pellerin
2016-02-24 15:49:42 -05:00
parent 5d90e28c18
commit 78b5a657f9
2 changed files with 50 additions and 36 deletions
+8 -1
View File
@@ -23,9 +23,16 @@ plugin.register.attributes = {
// optional options parameter
server.register({}, function (err) {});
// optional callback function with and without options
server.register({}).then((res: any) => {
console.log(res);
});
server.register({}, { select: "api", routes: { prefix: "/prefix" } }).then((res: any) => {
console.log(res);
});
// optional options.routes.vhost parameter
server.register({}, { select: 'api', routes: { prefix: '/prefix' } }, function (err) {});
server.register({}, { select: "api", routes: { prefix: "/prefix" } }, function (err) {});
//server.pack.register(plugin, (err: Object) => {
// if (err) { throw err; }