Initialize Your API Endpoint
Viewing typescript
switch to python
via the CLI
To create a new Consumption API endpoint, leverage the moose-cli consumption init
command.
Terminal
npx moose-cli consumption init <YOUR_API_ROUTE>
Terminal
moose-cli consumption init <YOUR_API_ROUTE>
<YOUR_API_ROUTE>
: The name of the route you want to create.
This command will generate a .ts
.py
file in the /apis
directory.
- YOUR_API_ROUTE.ts
- YOUR_API_ROUTE.py
For detailed information about the moose block init command, you can run the following in your terminal:
Terminal
npx moose-cli consumption init --help
Manually
You can alternatively manually create a new .ts
.py
file inside the /apis
folder of your project.