Serverless service which showcases how to build an API which is accessible through an API key.
Mar 10, 2017 The serverless-offline plugin is a different approach from what we have discussed before; it gives us a lot of benefits. Test your serverless application locally. Apr 10, 2020 New Users: Before you can start using the Google Maps Platform APIs and SDKs, you must sign up and create a billing account. To learn more, see Get Started with Google Maps Platform. To use the Maps JavaScript API you must have an API key. The API key is a unique identifier that is used to authenticate requests associated with your project for usage. Other content types are not blocked. Currently, API Gateway supports JSON Schema draft-04. #Setting source of API key for metering requests. API Gateway provide a feature for metering your API's requests and you can choice the source of key which is used for metering. If you want to acquire that key from the request's X-API-Key header, set. Mar 10, 2017 The serverless-offline plugin is a different approach from what we have discussed before; it gives us a lot of benefits. Test your serverless application locally, including the API Gateway.
Installation
Make sure that you use Serverless v1.
- Run
serverless install --url https://github.com/pmuens/serverless-secured-api
to install the service in your current working directory - Next up cd into the service with
cd serverless-secured-api
- Deploy with
serverless deploy
![Serverless Offline Get Api Key Generated Serverless Offline Get Api Key Generated](/uploads/1/2/6/4/126438602/234899854.png)
How to use
Simply perform a request against the exposed endpoint:
![Free Free](/uploads/1/2/6/4/126438602/909175222.png)
This request should return
Forbidden
:How To Get Api Key
Whereas this one should suceeds:(you get the API key in the info output after a successfull deployment or if you run
serverless info
)Serverless Offline S3
AWS services used
Aws Serverless Api
- Lambda
- API Gateway