GithubHelp home page GithubHelp logo

fast_api's Introduction

restful api with Fast API

source: https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker#quick-start source: https://codeburst.io/implement-a-production-ready-rest-service-using-fastapi-13f284562c75

Development

Change main.py From same folder run: uvicorn main:app --reload This will provide hot reload of webserver when changes are made to main.py

Docker

docker-compose up --build will start a webserver on localhost:8001 and documentation on localhost:8001/docs

VS Code

Extension to install: Remote-Containers Then in bottom left corner press green icon. (ctrl+shift+p -> Remote-Containers: attach to running container) choose "fast_api_server" from the list of running containers

open a terminal in vs code (it will open as root in the container). enter: uvicorn main:app --reload -> ctrl+click on the server link. A browser will open to show the api server

Make changes to main.py and see how the server is reloaded and changes takes effect in browser.

  • Inside the devcontainer.json file add: "remoteUser key": "vscode", in order to be logged in as vscode instead of root in the terminal (This means that ownership of new files will not be root and thereby locked for other users.). This was NOT WORKING since creating the user in the Dockerfile meant that existing files could not be editted by that user (Could not give it sudo privileges). LOOK more in to this

fast_api's People

Contributors

thomas-hartmann avatar dependabot[bot] avatar

Watchers

James Cloos avatar  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.