Giter Site home page Giter Site logo

fastapi-simple-todo-mock's Introduction

FastAPI Simple To-Do List Mock

A simple mock To-Do List API using FastAPI and Mongita.

todo-list-api-swagger-screenshot

Table of Contents

About

A simple mock To-Do List API using FastAPI and Mongita, with basic CRUD operations allowing you to create, update and delete tasks.

Built With

Getting Started

Installation

  1. Clone the repo
    git clone https://github.com/TomJGooding/fastapi-simple-todo-mock.git
  2. Install the requirements. It is recommended to first create a virtual environment.
    python3 -m pip install -r requirements.txt

Usage

Run the Server

Run the Uvicorn server with:

uvicorn main:app

Interact From the Browser (Swagger UI)

Swagger UI is a browser-based tool for interacting with REST APIs, and FastAPI creates this user interface for the API automatically.

Open your browser at http://localhost:8000/docs

For example, to create a new task:

  1. Expand the POST /todos Create Task item.
  2. Click the Try it out button, which will allow you to fill the parameters.
  3. Then click the Execute button. The user interface will communicate with your API, send the parameters, get the results and show them on the screen.

Interact From the Command Line (HTTPie)

HTTPie is a command-line HTTP client for interacting with APIs & HTTP servers.

You will need to have the FastAPI server running in the background.

For example, create a new task with:

http POST localhost:8000/todos id=1 title="Water the plants" complete=False

Acknowledgements

Licence

Licensed under the GNU General Public License v3.0.

fastapi-simple-todo-mock's People

Contributors

tomjgooding avatar

Watchers

 avatar

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.