Timeout Control
Timeout Control in MaskAPI lets you define a maximum execution time for each endpoint. This prevents long-running or stuck requests from slowing down your app or consuming unnecessary resources.
⌛ What is Timeout Control?
Every MaskAPI endpoint runs inside a secure, isolated environment with a time limit. By default, MaskAPI applies a timeout of 5 seconds but you can increase or decrease this limit based on your needs.
Maximum allowed timeout is 10 seconds. Any request taking longer than that will be automatically stopped and return a timeout error.
-
Speeding up your development
-
Learning how backend logic is structured
-
Rapid prototyping
🔧 How to Edit Your Project Timeout
If you'd adjust all the endpoints within a project, follow these steps:
-
Select your project
-
Go to the "Settings" tab
-
Under "Project Global Configurations" section
-
Enter the timeout value in "Request Timeout" field in milliseconds.
-
Click "Save Changes" on the top of the page
All new endpoints in the project will now use this timeout value by default.
If your function takes longer than the set timeout, it will be aborted, and the client will receive a 551 or 552 Status Code Error. For more info go to Special Stauts Code
⚙️ How to Overwrite the Global Timeout
If you a specific single endpoint to overwrite the Global Timeout, follow these steps:
-
Select your endpoint
-
Go to the "Config" tab
-
Under "Configuration" table
-
Click "Set Custom Config"
-
Add your request timeout value in "Request Timeout" field
🧪 How to Test Your Endpoint
In order to test your API:
- Use the Playground inside the Studio to send live test requests
- Use
console.log()
inside your endpoint to inspect values - View logs and debug output directly in MaskAPI Studio