Skip to main content

APIs Custom Code and Third-party Libraries Support

By default, custom code for APIs does not support importing third-party libraries. The custom code includes built-in standard Node.js libraries as well as node-fetch, request, @cloudbase/node-sdk, and their related dependency libraries. These built-in libraries can be referenced via require and used in the code.

Solutions

If you need to import third-party libraries, in addition to using custom code, you can also choose to directly integrate with Cloud Development Cloud Function. When creating APIs, you can opt to use Cloud Function as the execution backend.

Advantages of Cloud Development Cloud Function

  • Multi-language Support: Cloud functions are not limited to Node.js; they can also be developed using Python, PHP, Golang, Java, and other languages.

  • Flexible Dependency Introduction: Cloud functions allow developers to introduce required dependency libraries on their own.

  • Flexible Network Configuration: Cloud functions can access Tencent Cloud VPC networks through network configuration to integrate with existing cloud resources, databases, etc.

  • Timeout Control: Cloud functions allow developers to control the timeout period themselves, enabling code or tasks to run for longer durations.

  • Provisioned Concurrency Configuration: Cloud functions can improve request response speed by configuring provisioned concurrency to keep instances running.

Similar Issues

  • Can the custom code of APIs import third-party libraries?
  • How to resolve the issue that the custom code of APIs cannot import third-party libraries?
  • Which programming languages are supported by Cloud Development Cloud Function?
  • Can dependency libraries be freely introduced in cloud functions?
  • What are the advantages of cloud function network configuration?
  • Can cloud functions control the timeout period?
  • What is the purpose of the provisioned concurrency configuration in cloud functions?
  • What are the benefits of cloud functions compared to custom code?
  • Which libraries are built into the APIs custom code?
  • How to integrate APIs with Cloud Development Cloud Function?