Skip to content

Commit

Permalink
feat(web): support custom cors headers (#29382)
Browse files Browse the repository at this point in the history
## Current Behavior

It is not possible to pass custom cors headers to the
`@nx/web:file-server` executor despite `http-server` supporting it.

## Expected Behavior

`@nx/web:file-server` should pass-through a string of custom cors
headers to `http-server`.

## Related Issue(s)
  • Loading branch information
aidant authored Jan 9, 2025
1 parent bc7c809 commit f98ae78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/generated/packages/web/executors/file-server.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"description": "Path where the build artifacts are located. If not provided then it will be infered from the buildTarget executor options as outputPath"
},
"cors": {
"type": "boolean",
"oneOf": [{ "type": "boolean" }, { "type": "string" }],
"description": "Enable CORS",
"default": true
},
Expand Down
9 changes: 8 additions & 1 deletion packages/web/src/executors/file-server/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@
"description": "Path where the build artifacts are located. If not provided then it will be infered from the buildTarget executor options as outputPath"
},
"cors": {
"type": "boolean",
"oneOf": [
{
"type": "boolean"
},
{
"type": "string"
}
],
"description": "Enable CORS",
"default": true
},
Expand Down

0 comments on commit f98ae78

Please sign in to comment.