Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bin/http-server
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if (argv.h || argv.help) {
' -i Display autoIndex [true]',
' -e --ext Default file extension if none supplied [none]',
' -s --silent Suppress log messages from output',
' --contentType Define the content-type default value',
' --cors[=headers] Enable CORS via the "Access-Control-Allow-Origin" header',
' Optionally provide CORS headers list separated by commas',
' -o [path] Open browser window after starting the server',
Expand Down Expand Up @@ -102,6 +103,10 @@ function listen(port) {
proxy: proxy
};

if (argv.contentType) {
options.contentType = argv.contentType;
}

if (argv.cors) {
options.cors = true;
if (typeof argv.cors === 'string') {
Expand Down