Skip to content

Commit

Permalink
Add custom status code instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Marketionist committed Oct 16, 2023
1 parent 9d016c0 commit 10ad7a5
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Expand Up @@ -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: `<ul class="items">
<li>First</li>
<li>Second</li>
<li>Third</li>
<li>Fourth</li>
<li>Fifth</li>
<li>Sixth</li>
<li>Seventh</li>
<li>Eighth</li>
<li>Ninth</li>
<li>Tenth</li>
</ul>`
}
}
};
```

By default logs are disabled (`logsEnabled` is set to 0). You can set
`logsEnabled` config to one of 3 levels:
- 0 - logs disabled
Expand Down

0 comments on commit 10ad7a5

Please sign in to comment.