Skip to content

Commit 1f08a8b

Browse files
committed
docs: fix examples
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 79893a1 commit 1f08a8b

File tree

1 file changed

+10
-0
lines changed
  • lib/node_modules/@stdlib/net/http2-secure-server

1 file changed

+10
-0
lines changed

lib/node_modules/@stdlib/net/http2-secure-server/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ var http2ServerFactory = require( '@stdlib/net/http2-secure-server' );
3535
Returns a function to create an [HTTP/2][nodejs-http2] server.
3636

3737
```javascript
38+
var readFileSync = require( '@stdlib/fs/read-file' ).sync;
39+
3840
var opts = {
3941
'cert': readFileSync( resolve( __dirname, 'examples', 'localhost-cert.pem' ) ),
4042
'key': readFileSync( resolve( __dirname, 'examples', 'localhost-privkey.pem' ) )
@@ -50,6 +52,8 @@ The function supports the following parameters:
5052
To bind a request callback to a server, provide a `requestListener`.
5153

5254
```javascript
55+
var readFileSync = require( '@stdlib/fs/read-file' ).sync;
56+
5357
function requestListener( request, response ) {
5458
console.log( request.url );
5559
response.end( 'OK' );
@@ -72,6 +76,8 @@ In addition to the options supported by [`http2.createSecureServer`][nodejs-http
7276
To specify server options, provide an options object.
7377

7478
```javascript
79+
var readFileSync = require( '@stdlib/fs/read-file' ).sync;
80+
7581
var opts = {
7682
'port': 7331,
7783
'address': '0.0.0.0',
@@ -85,6 +91,8 @@ var http2Server = http2ServerFactory( opts );
8591
To specify a range of permissible ports, set the `maxport` option.
8692

8793
```javascript
94+
var readFileSync = require( '@stdlib/fs/read-file' ).sync;
95+
8896
var opts = {
8997
'maxport': 9999,
9098
'cert': readFileSync( resolve( __dirname, 'examples', 'localhost-cert.pem' ) ),
@@ -101,6 +109,8 @@ When provided a `maxport` option, a created server will search for the first ava
101109
Creates an [HTTP/2][nodejs-http2] server.
102110

103111
```javascript
112+
var readFileSync = require( '@stdlib/fs/read-file' ).sync;
113+
104114
function done( error, server ) {
105115
if ( error ) {
106116
throw error;

0 commit comments

Comments
 (0)