Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pmuens/serverless-secured-api
Serverless service which showcases how to build an API which is accessible through an API key
https://github.com/pmuens/serverless-secured-api
Last synced: 20 days ago
JSON representation
Serverless service which showcases how to build an API which is accessible through an API key
- Host: GitHub
- URL: https://github.com/pmuens/serverless-secured-api
- Owner: pmuens
- Created: 2016-10-11T19:58:05.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-11T21:00:18.000Z (about 8 years ago)
- Last Synced: 2023-03-24T08:12:05.464Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://serverless.com
- Size: 1.95 KB
- Stars: 10
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Serverless secured API
Serverless service which showcases how to build an API which is accessible through an API key.
## Installation
Make sure that you use Serverless v1.
1. Run `serverless install --url https://github.com/pmuens/serverless-secured-api` to install the service in your current working directory
2. Next up cd into the service with `cd serverless-secured-api`
3. Deploy with `serverless deploy`## How to use
Simply perform a request against the exposed endpoint:
This request should return `Forbidden`:
```bash
curl https://XXXX.execute-api.region.amazonaws.com/dev/greet
```Whereas this one should suceeds:
(you get the API key in the info output after a successfull deployment or if you run `serverless info`)```bash
curl https://XXXX.execute-api.region.amazonaws.com/dev/greet --header "x-api-key: "
```## AWS services used
- Lambda
- API Gateway