diff options
author | Ry Dahl <ry@tinyclouds.org> | 2019-11-07 14:00:27 -0500 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2019-11-07 11:00:27 -0800 |
commit | 709cb3c9ba0d968dc356861952a3c63129e57615 (patch) | |
tree | 9f6c66588907dcc9a86b38b4a4bb65dc4afead6e /std/http/server.ts | |
parent | 25c276055b3dfdcecd77d18a0c6ebfcee531442d (diff) |
Fix jsdoc in std/http/server.ts (#3284)
Diffstat (limited to 'std/http/server.ts')
-rw-r--r-- | std/http/server.ts | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/std/http/server.ts b/std/http/server.ts index db4150ef5..deedb0f12 100644 --- a/std/http/server.ts +++ b/std/http/server.ts @@ -228,9 +228,11 @@ function fixLength(req: ServerRequest): void { } } -// ParseHTTPVersion parses a HTTP version string. -// "HTTP/1.0" returns (1, 0, true). -// Ported from https://github.com/golang/go/blob/f5c43b9/src/net/http/request.go#L766-L792 +/** + * ParseHTTPVersion parses a HTTP version string. + * "HTTP/1.0" returns (1, 0, true). + * Ported from https://github.com/golang/go/blob/f5c43b9/src/net/http/request.go#L766-L792 + */ export function parseHTTPVersion(vers: string): [number, number] { switch (vers) { case "HTTP/1.1": @@ -450,19 +452,20 @@ export function serveTLS(options: HTTPSOptions): Server { /** * Create an HTTPS server with given options and request handler + * + * const body = new TextEncoder().encode("Hello HTTPS"); + * const options = { + * hostname: "localhost", + * port: 443, + * certFile: "./path/to/localhost.crt", + * keyFile: "./path/to/localhost.key", + * }; + * listenAndServeTLS(options, (req) => { + * req.respond({ body }); + * }); + * * @param options Server configuration * @param handler Request handler - * - * const body = new TextEncoder().encode("Hello HTTPS"); - * const options = { - * hostname: "localhost", - * port: 443, - * certFile: "./path/to/localhost.crt", - * keyFile: "./path/to/localhost.key", - * }; - * listenAndServeTLS(options, (req) => { - * req.respond({ body }); - * }); */ export async function listenAndServeTLS( options: HTTPSOptions, |