Commands Guide
Welcome to the Finch Commands Guide! This guide will walk you through the steps to use commands in your Finch application. Whether you're a seasoned developer or just starting, Finch offers a robust set of tools to simplify server-side web app development.
Adding Custom Commands
You can add custom commands to your Finch application. These commands can be used to perform various tasks such as database migration, language management, etc. To add a custom command, you need to use the addCommand method. Here is an example of how to use it:
Note:
Capp is a package that provides a simple way to manage commands in your application. you can use this package to add commands to your application. for more information please refer to the Capp package.
Run a command after start the server
You can run a command after start the server. for example you can run a database migration command after start the server. to do this you need to use the runCommand method. here is an example of how to use it:
in this example example is the name of the command and --test is the option that we want to pass to the command.
Note: you have to pass the arguments of main function to the runCommand method. for example if you have a --port option in your main function you have to pass this option to the runCommand method. for example: