Can you explain the structure of the new options JSON object for the server.register method in hapi.js?

Can anyone explain the new format for the options json object that needs to be passed to the server.register() method in hapijs?

This is how I structured my server.register() call.

server.register({
    register: require('good'),
    options: {
        opsInterval: 5000,
        reporters: [
            {
                reporter: require('good-file'),
                events: { ops: '*'},
                config: {
                    path: './logs',
                    prefix: 'hapi-process',
                    rotate: 'daily'
                }
            },
            {
                reporter: require('good-file'),
                events: { response: '*' },
                config: {
                    path: './logs',
                    prefix: 'hapi-requests',
                    rotate: 'daily'
                }
            },
            {
                reporter: require('good-file'),
                events: { error: '*' },
                config: {
                    path: './logs',
                    prefix: 'hapi-process',
                    rotate: 'daily'
                }
            }
        ]
    }
}, function(err) {
    console.log(err);
});

This is the error message I'm receiving:

Error: Invalid monitorOptions options child "reporters" fails because ["reporters" must be an object]
at Object.exports.assert (/home/rodrigo/Projetos/estudos/api/greetings-hapi/node_modules/hoek/lib/index.js:736:11)
at Object.exports.register (/home/rodrigo/Projetos/estudos/api/greetings-hapi/node_modules/good/lib/index.js:31:10)
at Object.target [as register] (/home/rodrigo/Projetos/estudos/api/greetings-hapi/node_modules/hapi/node_modules/joi/lib/object.js:77:34)
at each (/home/rodrigo/Projetos/estudos/api/greetings-hapi/node_modules/hapi/lib/plugin.js:318:14)
at iterate (/home/rodrigo/Projetos/estudos/api/greetings-hapi/node_modules/hapi/node_modules/items/lib/index.js:36:13)
at Object.exports.serial (/home/rodrigo/Projetos/estudos/api/greetings-hapi/node_modules/hapi/node_modules/items/lib/index.js:39:9)
at internals.Plugin.register (/home/rodrigo/Projetos/estudos/api/greetings-hapi/node_modules/hapi/lib/plugin.js:321:11)
at Object.<anonymous> (/home/rodrigo/Projetos/estudos/api/greetings-hapi/server.js:26:8)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)

It seems that "reporters" should be an object not an array. How should I structure it and what are the correct properties?

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The efficiency of Testing Library findBy* queries is optimized when utilized alongside async/await functionality

After reviewing the documentation, it was noted that queries made using findBy return a Promise. Interestingly, utilizing these queries with Promise.prototype.catch() seems ineffective in comparison to pairing them with async/await + try...catch. An insta ...

I am sending an AJAX request to a remote server in order to retrieve access records

Currently, I am attempting to retrieve data by sending an ajax request to a remote server controller from my current remote page. Below is the code for my first remote view page: <?php include 'header.php'; ?> <script src="/assets/js/ ...

Could you provide instructions on how to change mjs files into js format?

Is there a method to change .mjs files to .js files? Some hosting services do not yet support mjs files, so I am interested in converting them to js files. Context: Mozilla's PDFjs has incorporated JavaScript modules (mjs) into their code, but since ...

Utilizing Mysql Joins with parameterized queries in Node.js: A Comprehensive Guide

Currently, I am utilizing Node.js and Express.js for my project. In particular, I am incorporating the "mysql2 library" into my development process. My current task involves concatenating and joining queries with parameters in a secure manner. How can I ...

What is the best way to run a function within an if statement without duplicating code if the condition is false?

When working with relay mutation code, I find it necessary to reload the store in order for it to sync with the database. This is because if the text being added is the same as previously added text, the relay store throws an error called flattenChildren.. ...

Instructions on how to insert the meta tag with the attribute "http-equiv" set to "REFRESH" and the content "0; URL="somedomain"" into a division on a

Trying to send an ajax request to a page that includes the following meta tag: <meta http-equiv="REFRESH" content="0; URL=https://www.ohterDomain.com/help?nodeId=2&view=content-only"> After making a successful ajax call, the correct content is ...

Activate the capture property for the file selection based on the label that is selected

This is a form that consists of two labels: <form method="POST" action='/process' enctype="multipart/form-data"> <div> <label for="file" class="upload-button"><i class=" ...

Creating a sidebar that remains fixed in place even as the page is scrolled down can be achieved by using CSS and positioning properties

I am looking to create a website with a specific layout design as shown in this image: https://i.stack.imgur.com/ndKcz.png The main focus is on making the sidebar (F/T container) function as a social network link, sticking to the right side of the page ev ...

"Exploring the Method of Inheriting from a BaseComponent in Angular 2

I’ve been working on an Angular project and I’m looking to streamline the creation of components with shared functionality. For example, let’s say I have a TeacherIndexComponent: @Component({ selector: 'app-teacher-index', templateUrl: ...

Value of an object passed as a parameter in a function

I am trying to use jQuery to change the color of a link, but I keep getting an error when trying to reference the object. Here is my HTML : <a onmouseover="loclink(this);return false;" href="locations.html" title="Locations" class="nav-link align_nav" ...

What is the reason behind Angular's repeat filter only being able to access its own element within the return function?

I have successfully implemented some Angular code that is working, however, I am struggling to understand why it works. Coming from a C Sharp background and being new to JS and Typescript. <tr ng-repeat="colleague in Model.FilteredColleagueListModel | ...

Properly segmenting sections into components in Angular

My project has a specific folder structure as shown below: https://i.sstatic.net/7oihC.png In my list-page, I perform operations such as create, update, and delete using modal dialogs. I am considering creating 4 pages for each of these CRUD operations a ...

Split JSON properties into an array of individual objects

Struggling to convert a basic JSon object into an array of objects with keys and values separated, I'm facing some challenges. I've experimented with various approaches, but the closest I got was creating an object with two arrays instead of mul ...

Responsive screen sizing in Vue.js

https://i.stack.imgur.com/8qwpn.png I added a margin-left to my component due to it being blocked by the side-bar and the "Roles" table. Is there a way to shift my table to the right when the screen width is less than 992? I need it to be responsive acro ...

how can I instruct assertJsonEquals to disregard a specific field when performing comparisons

I've been utilizing the assertJsonEquals function from a library called JsonUnit In my code, I'm doing the following: assertJsonEquals(resource("ExpecedResponse.json"), ActualResponse, when(IGNORING_ARRAY_ORDER)); The ...

What is the best way to implement bypassSecurityTrustResourceUrl for all elements within an array?

My challenge is dealing with an array of Google Map Embed API URLs. As I iterate over each item, I need to bind them to the source of an iFrame. I have a solution in mind: constructor(private sanitizer: DomSanitizationService) { this.url = sanitizer. ...

After updating Angular Material, the alert dialogs are now transforming into a large dark region

Recently, I encountered an issue while attempting to upgrade my old version of angular-material (v0.9.0) to a newer one. The reason behind this upgrade was the necessity to utilize the new htmlContent for an alert using $mdDialog. However, after replacing ...

Looking out for JavaScript errors using Selenium?

Currently, I am utilizing Selenium through Python and employing the web driver with the Chrome backend. My goal is to verify that at the completion of each test there were no JavaScript exceptions thrown throughout the execution -- essentially mimicking t ...

Measuring Load Time Percentage in AngularJS Using $http Requests

I am currently utilizing Angular with my Rails application. I have a sample app and I am interested in displaying the response time required to load a response in Angular. For example, When loading a response of an array containing 100,000 elements, I w ...

Update the variable in a PHP script and execute the function once more without the need to refresh the page

Hey there, I'm wondering if AJAX is necessary for the functionality I want to implement. Here's the scenario: I have a function that generates a calendar and I plan to add 'forward' and 'backward' arrows so users can navigate ...