Giter Club home page Giter Club logo

blogstate-api's People

Contributors

roshnet avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

blogstate-api's Issues

Format date to human readable format

Description

On all endpoints that return a date (for example, on returning posts), a small script can be inserted that converts the current date format 2019-11-03 to a more convenient format, say October 30, 2019.

There is a possible use case in the main application of using a library like MomentJS to add more convenient formats.

Set suitable status code on bad responses

Currently, in cases where the query is unsuccessful, the response still has a status code of default 200.

There needs to be a suitable HTTP status code allotted to the response, to better handle and debug the API.

tests: Validate structure of request body before processing

Description

As of now, for POST /login and POST /signup, the request body needs to have a specific structure.
If that structure of request body is different from what is assumed in handling it, an exception is caused, which can cause entire server to halt, and other undesired effects.

Fix

This can be prevented by validating request body structure, and returning appropriate response if the structure is corrupt.

bug: Cannot make more than one API call after server starts

Description

When subsequent requests are sent, only the first call executes.
This gives a peewee.OperationalError: Connection already opened. error.

Possible cause

Peewee is configured to make a call to the database on each request, as falcon.API()'s middleware.
This seems to override the already opened connection that was opened on the first API call.

Possible solution

Since it's the middleware that performs the database call, a check needs to be put in the middleware on whether the current connection state is opened or closed.

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.