Deployment
Deploying a Toolpad app is like deploying any other React/Node application.
Pre-requisites
This guide assumes that you have copied your project folder to the server, and all subsequent commands are run inside it.
Make sure to add the following scripts to your
package.json
"scripts": {
"dev": "toolpad dev"
"build": "toolpad build"
"start": "toolpad start"
}
Install step
Install required depdencies via:
npm install
Build step
This command will create an optimized production build for the Toolpad app and will output the generated files:
npm run build
Start step
Once the build has been made, you can deploy it to any service of your choice!
To serve the app once built, run:
npm run start
If you want to listen on a specific port you can change the start script to:
"start": "toolpad start -p 1234"
Custom base path
Toolpad applications can run under a custom base path. Use the --base
CLI parameter to set a base under which the Toolpad application is hosted.
toolpad dev --base /foo
Now the Toolpad application is accessible under http://localhost:3000/foo
. The --base
parameter must be supplied to the build
command. A build always has one specific base path:
toolpad build --base /foo
toolpad start --base /foo
Detailed guides
Detailed, step-by-step instructions are available for the following services: