Skip to content
Snippets Groups Projects
Commit 8407e9ea authored by Richard Fernando Heise Ferreira's avatar Richard Fernando Heise Ferreira
Browse files

Merge branch 'issue/2-criar-rota-cadastro' into 'main'

Issue #2: CRIA rota de cadastro

See merge request !1
parents 49c8a823 371e1b19
No related branches found
No related tags found
1 merge request!1Issue #2: CRIA rota de cadastro
__pycache__
\ No newline at end of file
3.11.2
main.py 0 → 100644
from fastapi import FastAPI
from src.User import User
app = FastAPI()
fake_db = []
@app.get("/")
async def root():
return fake_db
@app.post("/signup")
async def create_user(user: User):
fake_db.append(user)
return fake_db
This diff is collapsed.
[tool.poetry]
name = "portalmec-python-back"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"
packages = [{include = "portalmec_python_back"}]
[tool.poetry.dependencies]
python = "^3.11"
fastapi = "^0.93.0"
uvicorn = {extras = ["standard"], version = "^0.20.0"}
pydantic = "^1.10.6"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
from pydantic import BaseModel, Field
class User(BaseModel):
username: str
email: str = Field(regex="([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+")
password: str = Field(min_length=8)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment