Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
chltjdbs committed May 16, 2024
1 parent 699bef3 commit 9b0c1a7
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
Binary file modified README.md
Binary file not shown.
Binary file added __pycache__/main.cpython-311.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions count.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21
55 changes: 55 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
from typing import Union
from fastapi import FastAPI

app = FastAPI()


f = open("count.txt", 'r')
line = f.read()


count = int(line)


f.close()

# f = open("count.txt", 'w')
# f.write("hi")
# f.close

@app.get("/plus")
def counter():
global count
count = count + 1
f = open("count.txt", 'w')
f.write(str(count))
f.close


return "1 증가"


@app.get("/lookup")
def look():
global count
return count




@app.get("/mul/{item1}/{item2}")
def mul(item1:int, item2:int):
return {item1*item2}

@app.get("/add/{item1}/{item2}")
def add(item1: int, item2: int):
return {"result": item1 + item2}

@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}

0 comments on commit 9b0c1a7

Please sign in to comment.