Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 41 for read_root (0.23 sec)

  1. docs/ru/docs/deployment/docker.md

    * Создайте пустой файл `__init__.py`.
    * Создайте файл `main.py` и заполните его:
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    ### Dockerfile
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 57.5K bytes
    - Viewed (0)
  2. docs/de/docs/deployment/docker.md

    * Erstellen Sie eine `main.py`-Datei mit:
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    ### Dockerfile
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:19:17 GMT 2024
    - 38.9K bytes
    - Viewed (0)
  3. docs/en/docs/deployment/docker.md

    * Create an empty file `__init__.py`.
    * Create a `main.py` file with:
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    ### Dockerfile
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 34K bytes
    - Viewed (0)
  4. docs/pt/docs/deployment/docker.md

    * Crie um arquivo vazio `__init__.py`.
    * Crie um arquivo `main.py` com:
    
    ```Python
    from typing import Optional
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    ### Dockerfile
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 37.4K bytes
    - Viewed (0)
  5. tests/test_response_model_as_return_annotation.py

        assert response.json() == {"foo": "bar"}
    
    
    def test_invalid_response_model_field():
        app = FastAPI()
        with pytest.raises(FastAPIError) as e:
    
            @app.get("/")
            def read_root() -> Union[Response, None]:
                return Response(content="Foo")  # pragma: no cover
    
        assert "valid Pydantic field type" in e.value.args[0]
        assert "parameter response_model=None" in e.value.args[0]
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Aug 14 09:49:57 GMT 2023
    - 47.7K bytes
    - Viewed (0)
  6. docs/em/docs/deployment/docker.md

    * ✍ `app` 📁 & ⛔ ⚫️.
    * ✍ 🛁 📁 `__init__.py`.
    * ✍ `main.py` 📁 ⏮️:
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    ### 📁
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 27.9K bytes
    - Viewed (0)
  7. docs/zh/docs/deployment/docker.md

    * 创建`app`目录并进入。
    * 创建一个空文件`__init__.py`。
    * 创建一个 `main.py` 文件:
    
    
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    ### Dockerfile
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 31.2K bytes
    - Viewed (0)
  8. docs/ko/docs/deployment/docker.md

    * 빈 파일 `__init__.py`을 생성합니다.
    * 다음과 같은 `main.py`을 생성합니다:
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    ### 도커파일
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 42.6K bytes
    - Viewed (0)
  9. docs/ja/docs/deployment/docker.md

    * 空のファイル `__init__.py` を作成します
    * `main.py` ファイルを作成します:
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    ### Dockerfile
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 44.3K bytes
    - Viewed (0)
  10. cni/pkg/nodeagent/ztunnelserver.go

    	return z.readMessage(readWriteDeadline)
    }
    
    func (z *ZtunnelConnection) readMessage(timeout time.Duration) (*zdsapi.WorkloadResponse, error) {
    	m, _, err := readProto[zdsapi.WorkloadResponse](z.u, timeout, nil)
    	return m, err
    }
    
    func readProto[T any, PT interface {
    	proto.Message
    	*T
    }](c *net.UnixConn, timeout time.Duration, oob []byte) (PT, int, error) {
    	var buf [1024]byte
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 12.4K bytes
    - Viewed (0)
Back to top