Code Monkey home page Code Monkey logo

chalice-restful's People

Contributors

joshua-light avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dldinternet-rs

chalice-restful's Issues

Set up CI/CD

Acceptance Criteria

  • The project is built and tested on PRs.
  • The project is built, tested and published after each successful push to master branch.

Requirements

  • GitHub Actions should be used as a CI/CD server.
  • pytest should be used as a test runner.

Create initial project structure

Motivation

Initial project structure will help future development of the features.

Acceptance Criteria

  • The project is an empty Python package.
  • It's ready to be published to the PyPi.

Requirements

  • There should be one fake unit-test, that will be discoverable by pytest.

Resources

As an API developer, I want to define my endpoints using object-oriented style.

Motivation

Chalice uses a plain functions approach, where each endpoint is defined by a separate function decorated with the route decorator. For example:

app = Chalice(...)

@app.route('/a')
def a(): ...

@app.route('/b')
def b(): ...

@app.route('/c')
def c(): ...

When there are a lot of endpoints, related to different resources, we need to group functions together, and this in fact is a motivation for the Resource concept.

API

The API will be similar to flask-restful one.

@route('/v1/items')
class Items(Resource):
    def get(): ...
    def post(): ...

@route('/v1/items/{item})
class Item(Resource):
    def get(item: str): ...
    def patch(item: str): ...
    def delete(item: str): ...

app = Chalice(...)
api = Api(app)
api.add_resource(Items)
api.add_resource(Item)

Acceptance Criteria

  • I can define grouped endpoints using Resource class.
  • I can require API keys for any endpoint.
  • I can enable/disable CORS for any endpoint.
  • I can add an authorizer to any endpoint.

Requirements

  • Code should be tested.
  • Code should be documented.
  • Tutorial should be added to the 'README' file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.