Comments (3)
Stop torturing him @ParentJA :-) - question, why use this framework instead of Serverless https://www.serverless.com ? Up https://up.docs.apex.sh ? Architect https://arc.codes/guides/offline? You might want to add yourself to https://github.com/anaibol/awesome-serverless
from minik.
@incognos great resources indeed! however, using a nodejs
library to write python serverless API is not ideal at all. Also, if you're interested in python frameworks, I would actually suggest https://github.com/aws/chalice
The main purpose of this project was to create a minimal serverless framework. This means it will not have full feature parity with django or flask, but it will be functional and lightweight.
Give it a try!
from minik.
Using metadata annotations seems to be a really natural fit for this type of feature. After a few iterations, this is how the route definition looks like:
@sample_app.route('/articles/{year}/{month}/', methods=['GET'])
def get_articles_view(year: int, month: int):
# match /articles/2015/10/
# match /articles/2020/5234 which is not ideal.
# does not match /articles/2020/ten
assert isinstance(year, int) and isinstance(month, int)
return {'year': year, 'month': month}
Note that in order to implement the uuid
, I was able to use the standard uuid.UUID
class. The added advantage is that the product_id field that gets passed to the view is already an instance of the object.
@sample_app.route('/product/{product_id}/', methods=['GET'])
def get_product(product_id: uuid.UUID):
assert isinstance(product_id, uuid.UUID)
return {'id': str(product_id)}
Thoughts?
from minik.
Related Issues (20)
- Feature Request: Support for content types
- Same route different views
- Expose the aws event
- GZIP of request, responses
- README: Not possible to test with `sam local`? HOT 1
- Add validation hook to route definition
- Native schema support
- Add debug mode
- Add single method decorators
- Support CORS HOT 1
- Request factory middleware
- Feature Request: Async tasks to run a method in a new lambda instance
- Feature Request: API Version management
- Feature Request: Support ALB requests
- Feature Request: Expose fixtures for testing purposes
- bug: Attribute error when handling requests
- query_params do not parse spaces HOT 2
- Support HTTP methods in routing HOT 1
- Setup sphinx
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minik.