@nrwl/angular:file-server

Serves a static web application from a folder.

Options can be configured in project.json when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/reference/project-configuration#targets.

Examples

Set up http-server to host static files on a local webserver.

{ "static-serve": { "executor": "@nrwl/angular:file-server", "options": { "buildTarget": "app:build", "port": 4201 } } }

Options

buildTarget

Required
string

Target which builds the application.

cors

boolean
Default: true

Enable CORS

host

string
Default: localhost

Host to listen on.

maxParallel

number

Max number of parallel jobs.

parallel

boolean
Default: true

Build the target in parallel.

port

number
Default: 4200

Port to listen on.

proxyUrl

string

URL to proxy unhandled requests to.

proxyOptions

Default: {}

Options for the proxy used by http-server.

ssl

boolean
Default: false

Serve using HTTPS.

sslKey

string

SSL key to use for serving HTTPS.

sslCert

string

SSL certificate to use for serving HTTPS.

spa

boolean
Default: false

Redirect 404 errors to index.html (useful for SPA's).

watch

boolean
Default: false

Watch for file changes.