Skip to content

cckcoder/fast-api-basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fast-api-basic

Presentation

  • FastApi FastApi คืออะไร?

    • FastApi ทำงานอย่างไร
    • ใครเป็นคนสร้าง
    • FastApi In production
  • RESTFul

    • What's RESTFul
    • มีประโยชน์อย่างไร
    • Concept of restful
  • CRUD

    • คืออะไร
  • Tools

    • VSCode Extension

      • python
      • pylance
    • pip

Coding Time.

  • Install Fast Api with pip

    • python3 -m venv env
    • pip install fastapi
    • pip install uvicorn[standard]
  • Install Fast Api with pip (Windows)

    • python -m venv env
    • env/Scripts/activate
    • pip install fastapi
    • pip install uvicorn[standard]
  • Hello world

    • Ref
    • Create simple fast-api
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    async def root():
        return {"message": "Hello World"}
    • run api uvicorn main:app --reload
  • Swagger UI

  • Path Parameters

    • get book by name
        from fastapi import FastAPI
    
        app = FastAPI()
    
    
        @app.get("/books/{book_name}")
        async def read_item(book_name: str):
            return {"book_name": book_name}
  • Pydantic

    • Ref
    • What's pydantic
      • it's data validation

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages