Serve
Launch a local web server that is used to run the playground or Visual Studio Code.
Run from the workspace root:
port
The default port is 8003
. You can specify the port by setting the --port
flag.
API key
The API key is used to authenticate the requests to the server.
You can specify an API key by setting the --api-key
flag or the GENAISCRIPT_API_KEY
environment variable.
or
The API key can be set in the Authorization
header of a request or in the URL query parameter api-key
(http://localhost:8003/#api-key=my-api-key
)
CORS
You can enable Cross Origin Shared Resource by setting the --cors
flag or setting the GENAISCRIPT_CORS_ORIGIN
environment variable.
Network
You can bind the server to 0.0.0.0
and make it accessible from the network by setting the --network
flag.
We highly recommend setting the API key when running the server on the network.