Configuration
Platformatic Next is configured with a configuration file. It supports the use of environment variables as setting values with configuration placeholders.
application
Supported object properties:
basePath
: Service proxy base path when exposing this application in a composer when setting theproxy
property. If not specified, the service will be exposed on the service or a value specified in the service code viaplatformatic.setBasePath()
.outputDirectory
: The subdirectory where production build is stored at when usingwattpm build
orplt build
. The default isdist
.include
: The paths to include when deploying the service. The default is['dist']
.commands
: An object specifying the commands to manage the application instead of using the Next defaults. Supported commands are:install
: The command to execute to install the service dependencies. The default isnpm ci --omit-dev
.build
: The command to execute to build the application.development
: The command to execute to start the application in development mode.production
: The command to execute to start the application in production mode.
logger
Configures the logger, see the logger configuration for more information.
server
Configures the HTTP server, see the runtime documentation.
watch
Manages watching of the service, see the service documentation.
caching
Configures an Incremental Server Rendering cache handler.
Supported object properties:
adapter
: The adapter to use. The only supported value isvalkey
(of whichredis
is a synonym).url
: The URL of the Valkey/Redis server.prefix
: The prefix to use for all cache keys.maxTTL
: The maximum life of a server key, in seconds. If the Next.jsrevalidate
value is greater than this value, then the adapter will refresh the key expire time as long as it is accessed everymaxTTL
seconds. The default value is604800
(one week).
Issues
If you run into a bug or have a suggestion for improvement, please raise an issue on GitHub or join our Discord feedback channel.