https://github.com/siemienik/siemply
Siemply is super SIMPLE handlers framework for AWS Lambda.
https://github.com/siemienik/siemply
aws aws-lambda hacktoberfest http typescript
Last synced: 12 months ago
JSON representation
Siemply is super SIMPLE handlers framework for AWS Lambda.
- Host: GitHub
- URL: https://github.com/siemienik/siemply
- Owner: Siemienik
- License: mit
- Created: 2022-09-28T22:47:14.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-15T21:35:16.000Z (over 3 years ago)
- Last Synced: 2025-03-13T04:35:14.663Z (about 1 year ago)
- Topics: aws, aws-lambda, hacktoberfest, http, typescript
- Language: TypeScript
- Homepage:
- Size: 27.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Siemply
Siemply is super SIMPLE handlers framework for AWS Lambda.
```ts
export handlerCountrySingle = siemply()
.step(findCountryStep);
// Example step construction
export handlerProvinceCollection = handlerCountrySingle.step(({country, ...payload})=>({
...payload,
country, //types provided
provinces: findAllProvinces({country:country.id})
}));
// Nesting handlers: /countries/{countryId}/provinces/{provinceId}
export handlerProvinceSingle = handlerCountrySingle.step(findProvinceInCountryStep);
// /countries/{countryId}/provinces/{provinceId}/cities
export handlerCityCollection = handlerCountrySingle.step(findCitiesInProvinceInCountryStep);
// /countries/{countryId}/provinces/{provinceId}/cities/{cityId}
export handlerCitySingle = handlerCountrySingle.step(({$event, country, province ...payload})=>({
$event,
...payload,
country,
province,
city: findCity($event?.queryParameters?.cityId, {countryId: country.id, provinceId: province.id}),
}));
export handlerCityRemove = handlerCitySingle.step(({city, ...payload})=>{
removeCity(city.id);
return {
...payload,
city,
$statusCode: 204
};
);
```
## Development:
* `yarn tsc` to run builder.
## Todos:
* [ ] linter
* [ ] Jest / pure handler
* [ ] Jest / labda handler