Vapor: HTTP APIs / API Gateway 2.0

Apr, 10 2020#vapor

When you launch an application on Laravel Vapor, we use AWS API Gateway to point web traffic to the AWS Lambda function that is powering your application. Normally, this is all magic that happens behind the scenes when using Vapor.

A few months ago, Amazon released API Gateway 2.0 (HTTP APIs) with significantly reduced pricing. So, today we are thrilled to announce that Vapor now supports HTTP APIs for applications running on Laravel Vapor. Applications running on API Gateway 2.0 can expect up to a 70% cost reduction and 60% faster request routing.

API Gateway 1.0 charged $3.50 per million requests to your application. When using API Gateway 2.0, you will only be charged $1.00 per million requests.

To use the new HTTP APIs, you must define a gateway-version for an environment within your vapor.yml file:

gateway-version: 2

After adding this to your configuration file and deploying project, Vapor will automatically migrate the environment to API Gateway 2.0.

You can read more about HTTP APIs on the AWS Compute Blog.

By Mohamed Said

Software Engineer at Laravel.

Follow the RSS Feed.