# API Gateway :::info 日期 : 2025/04/06 ::: API Gateway 是個Serverless整合性接口 *後端服務 <-> API <-> 前端服務 ------- #### 用途 後端 : 資料庫、邏輯處理、身份驗證 -> Lambda(最常見,A/B 測試)、EC2、S3(拿靜態資料)、DynamoDB 前端 : 使用者、App、瀏覽器、IoT 設備、第三方服務 -> REST、HTTP、WebSocket(即時通訊) API --- #### 使用流程 1. 使用者點擊https://api.mysite.com/users 2. API Gateway 收到請求,轉發到後端服務像是 Lambda 3. Lambda 處理 + 回傳資料給 API Gateway 4. API Gateway 將資料傳給使用者 API Gateway(定義 REST API) → Lambda(實際執行邏輯) --- #### 設定 Resources : 後端的資源 Method : GET, POST, PUT... Stages : 環境 ex.dev、prod... API Keys : 呼叫 API 時的身份認證機制 --- #### 架構 這張 aws 圖很精闢  *加 CloudFront 可提升拿資料速度 --- #### HTTP Methods GET → Read POST → Create PUT → Update PATCH → Update 部分 DELETE → Delete --- https://godleon.github.io/blog/Serverless/AWS-Serverless_API-Gateway/
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.