Skip to content

Commit 9cc00f1

Browse files
committed
Fix errors before release!!
Signed-off-by: Reece Dunham <[email protected]>
1 parent c503237 commit 9cc00f1

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

source/index.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,26 @@ program
3939
)
4040
.option("--no-render-markdown", "don't render markdown files as HTML")
4141

42-
program.parse(process.argv)
42+
const opts = program.parse(process.argv).opts()
4343

4444
/**
4545
* The port that the server will run on.
4646
*/
47-
const port: number = Number.parseInt(program.port)
47+
const port: number = Number.parseInt(opts.port)
4848

49-
if (program.root) {
50-
root = program.root
49+
if (opts.root) {
50+
root = opts.root
5151
}
52-
if (program.noRenderMarkdown) {
52+
53+
if (opts.noRenderMarkdown) {
5354
renderMarkdown = false
5455
}
55-
if (program.enhancedSecurity) {
56+
57+
if (opts.enhancedSecurity) {
5658
enhancedSecurity = true
5759
}
58-
if (program.noRequestLogging) {
60+
61+
if (opts.noRequestLogging) {
5962
logRequests = false
6063
}
6164

source/serverHandling.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ const handle = (
2222
// last ditch attempt to make sure this isn't just a case where its something like about-us.html
2323
// being used like /about-us in the browser, which is fairly common now
2424
if (existsSync(`${filePath}.html`)) {
25-
return handleRealFile(response, "html", enhancedSecurity, `${filePath}.html`)
25+
return handleRealFile(
26+
response,
27+
"html",
28+
enhancedSecurity,
29+
`${filePath}.html`
30+
)
2631
}
2732

2833
response.statusCode = err.code === "ENOENT" ? 404 : 500

0 commit comments

Comments
 (0)