From 10ad7a532177f8f8230aa9dbca617bf910a35c9f Mon Sep 17 00:00:00 2001 From: Marketionist Date: Mon, 16 Oct 2023 08:34:49 -0400 Subject: [PATCH] Add custom status code instructions --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 3e45680..a83409e 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,36 @@ nodeTestingServer.config = { }; ``` +Also if you want to specify a status code that will be returned by the page: + +```javascript +let { nodeTestingServer } = require('node-testing-server'); + +// Settings for node testing server +nodeTestingServer.config = { + hostname: 'localhost', + port: 3001, + logsEnabled: 0, + pages: { + '/test.html': { + pageStatusCode: 201, + pageBody: `` + } + } +}; +``` + By default logs are disabled (`logsEnabled` is set to 0). You can set `logsEnabled` config to one of 3 levels: - 0 - logs disabled