https://github.com/markusl/kilometrikisa-proxy
https://github.com/markusl/kilometrikisa-proxy
aws es6 javascript kilometrikisa lambda serverless
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/markusl/kilometrikisa-proxy
- Owner: markusl
- Created: 2017-11-03T11:28:48.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T19:06:51.000Z (over 3 years ago)
- Last Synced: 2025-04-06T09:28:25.967Z (about 1 year ago)
- Topics: aws, es6, javascript, kilometrikisa, lambda, serverless
- Language: JavaScript
- Size: 4.85 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## What is this?
Kilometrikisa-proxy is a simple proxy service for accessing data in Kilometrikisa.fi site.
There service includes four endpoints:
- /login which fetches basic details of user
- /user
- /team
- /updateLog
## Deployment
Add the necessary AWS credentials to your environment and run.
```
serverless deploy
```
The command will create a lambda function and needed endpoints to API gateway.
To remove the service, simply run
```
serverless deploy
```
## Testing
You can invoke the lambda function directly using sample data.
```
serverless invoke local -f kilometrikisa-handler -l --path examples/login1.json
serverless invoke local -f kilometrikisa-handler -l --path examples/user.json
serverless invoke local -f kilometrikisa-handler -l --path examples/team.json
```
The cloud deployed version can be tested leaving out the locale keyword.
```
serverless invoke -f kilometrikisa-handler -l --path examples/login1.json
serverless invoke -f kilometrikisa-handler -l --path examples/user.json
serverless invoke -f kilometrikisa-handler -l --path examples/team.json
```
Or by using curl
```
curl 'https://api-address.execute-api.eu-west-1.amazonaws.com/prod/login?username=username_here&password=pw_here'
curl 'https://api-address.execute-api.eu-west-1.amazonaws.com/prod/user?username=username_here&password=pw_here'
curl 'https://api-address.execute-api.eu-west-1.amazonaws.com/prod/team?username=username_here&password=pw_here'
```