

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 撰寫函數程式碼
<a name="writing-function-code"></a>

您可以使用 CloudFront Functions 撰寫 JavaScript 的輕量型函數，以進行高擴展性、對延遲敏感的 CDN 自訂。您的函數程式碼可以操作流經 CloudFront 的請求和回應，執行基本身分驗證和授權，在邊緣產生 HTTP 回應等。

為協助您為 CloudFront Functions 撰寫函數程式碼，請參閱下列主題。如需程式碼範例，請參閱 [CloudFront 的 CloudFront Functions 範例](service_code_examples_cloudfront_functions_examples.md) 和 GitHub 上的 [amazon-cloudfront-functions 儲存庫](https://github.com/aws-samples/amazon-cloudfront-functions)。

**Topics**
+ [確定函數的用途](function-code-choose-purpose.md)
+ [事件結構](functions-event-structure.md)
+ [JavaScript 執行時期功能](functions-javascript-runtime-features.md)
+ [鍵值存放區的協助程式方法](functions-custom-methods.md)
+ [原始伺服器修改的 Helper 方法](helper-functions-origin-modification.md)
+ [CloudFront SaaS Manager 屬性的 helper 方法](saas-specific-logic-function-code.md)
+ [使用 async 和 await](async-await-syntax.md)
+ [CloudFront Functions 的 CWT 支援](cwt-support-cloudfront-functions.md)
+ [一般協助程式方法](general-helper-methods.md)