-
Notifications
You must be signed in to change notification settings - Fork 6
CLI
LeChatErrant edited this page Apr 9, 2021
·
16 revisions
The template comes with a Command-Line Interface that helps you to initialize, develop and maintain your projects.
It essentially saves your time by writing boilerplate code for you
The CLI is listed in the dev-dependencies of the template, so all you need to do is
npm install
npm run cli
If you want to, you can install the cli globally with npm install -g templated-project-cli
to be able to launch it with from anywhere
Each time you need to add a new resource to your API, you need to write some boilerplate code (router, middlewares, controllers, tests, and more...)
The CLI save your time by writing this code for you
npm run cli
- Choose
generate new API resource
- Enter the name of the resource to be created (singular form)
- The CLI will infer the plural form. In case it is not correct, you can still write it by hand
- Relax and take a coffee
- Default model in
schema.prisma