-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Adding contentType cli option to address #276 #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ if (argv.h || argv.help) { | |
' -s --silent Suppress log messages from output', | ||
' --cors[=headers] Enable CORS via the "Access-Control-Allow-Origin" header', | ||
' Optionally provide CORS headers list separated by commas', | ||
' --contentType Use a custom Content-Type response header for all requests', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. possibly even more clear, though a long option, |
||
' -o [path] Open browser window after starting the server', | ||
' -c Cache time (max-age) in seconds [3600], e.g. -c10 for 10 seconds.', | ||
' To disable caching, use -c-1.', | ||
|
@@ -109,6 +110,10 @@ function listen(port) { | |
} | ||
} | ||
|
||
if (argv.contentType) { | ||
options.contentType = argv.contentType; | ||
} | ||
|
||
if (ssl) { | ||
options.https = { | ||
cert: argv.C || argv.cert || 'cert.pem', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should match the style of other switches by using
--content-type