How to test API in a local instance
Last updated
Last updated
To test API in your local instance, you have the following pre-requisites:
Cal.com repo clone. You can get it by following the instructions provided in Installation
A staging license key that goes in as value for CALCOM_LICENSE_KEY
in your root .env
file.
To get the staging license key, please proceed to create a dev account on console.cal.dev
Next, click on New Deployment
Then, click on Next with Self-hosted selected
Next, type in your deployment name as you like
Finally, you would be taken to the test Stripe payment page. This is where you enter the Stripe test card information. So, simply enter 4242 4242 4242 4242
as the card number, fill the rest as you wish and finish the payment step.
Once this is done, you will be redirected to your deployments page containing the list of your deployments. You can then click on the newly created deployment to copy the license key, which is your test license key.
Next, you need to install API submodule by following the instructions provided in API submodule
Start the cal.com server using yarn dev
on localhost and create the test API keys by visiting /settings/developer/api-keys
Start the API server by running yarn workspace @calcom/api dev
and start testing your API locally
By default, the app server runs on port 3000 and the API server runs on port 3002