From f61ec36c06c4b051b1a00a4a17f719fd11948671 Mon Sep 17 00:00:00 2001 From: Atila Romero Date: Thu, 12 Sep 2024 14:52:49 -0700 Subject: [PATCH] examples were swapped --- static/lib/tutorials/en_US/expresstohapi.md | 36 ++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/static/lib/tutorials/en_US/expresstohapi.md b/static/lib/tutorials/en_US/expresstohapi.md index 22b6440..267c688 100644 --- a/static/lib/tutorials/en_US/expresstohapi.md +++ b/static/lib/tutorials/en_US/expresstohapi.md @@ -268,24 +268,6 @@ module.exports = function (options) { }; ``` -hapi: -```js -server.register({ - plugin: getDate, - options: { - name: 'Tom' - } -}) -``` -To get access to the options in hapi, you simply refer to the `options` object when you create the plugin: - -Express: -```js -const getDate = require('./mw/getDate.js'); - -app.use(getDate({ name: 'Tom' })); -``` - hapi: ```js const getDate = { @@ -303,6 +285,24 @@ const getDate = { } }; ``` +To get access to the options in hapi, you simply refer to the `options` object when you create the plugin: + +Express: +```js +const getDate = require('./mw/getDate.js'); + +app.use(getDate({ name: 'Tom' })); +``` + +hapi: +```js +server.register({ + plugin: getDate, + options: { + name: 'Tom' + } +}) +``` ## body-parser