]> insang Git - back_nicezip_fastapi.git/commitdiff
백엔드서버로 변경
authornewton-cn <insang@kakao.com>
Tue, 23 Apr 2024 08:39:30 +0000 (17:39 +0900)
committernewton-cn <insang@kakao.com>
Tue, 23 Apr 2024 08:39:30 +0000 (17:39 +0900)
app/main.py
app/routers/example.py
runserver
static/js/example.js [deleted file]
templates/main/index.html [deleted file]

index 1b5a1c4c79adc8639772f4501f76bb323f4f197e..5d38a6bca3f5994365af8ec7656a8c011c02156f 100644 (file)
@@ -19,11 +19,11 @@ templates= Jinja2Templates(directory= "templates")
 #exam = app.include_router(example.router)
 app.include_router(example.router)
 
-@app.get("/")
-async def index(request: Request):
-  return templates.TemplateResponse(
-    request= request, name= "main/index.html"
-  )
+@app.get("/")
+async def index(request: Request):
+  return templates.TemplateResponse(
+    request= request, name= "main/index.html"
+  )
 
 if __name__ == '__main__':
   uvicorn.run(app= "main:app", host= "0.0.0.0", port= 33001, reload= True)
index 2f823b88776d9fb32c0a9d6ab35a65515e42d735..b5bd2c52d082a2b8a201bb4cf628715913eb5193 100644 (file)
@@ -14,9 +14,9 @@ async def exam1(param: str):
     return {"msg": f"exam: {param}"}
 
 #url데이터 받아서 템플릿에 넘겨주기
-@router.get('/exam2/{param}')
-async def exam2(request: Request, param: str):
-    return templates.TemplateResponse(request= request, name= "main/index.html", context={"param": param})
+@router.get('/exam2/{param}')
+async def exam2(request: Request, param: str):
+    return templates.TemplateResponse(request= request, name= "main/index.html", context={"param": param})
 
 #get 데이터 받기
 @router.get('/exam3')
index acf42f6b3503c99b853c6c7136ec57a3372ece54..d1e7da5714bca83fdf94c90f0463dd7c48a2cc60 100644 (file)
--- a/runserver
+++ b/runserver
@@ -1,2 +1,2 @@
 fuser -k 33001/tcp
-nohup .venv/bin/python3.10 app/main.py nicezip.zois.kr:33001 &
+nohup .venv/bin/python3.10 app/main.py back-nicezip.zois.kr:33001 &
diff --git a/static/js/example.js b/static/js/example.js
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/templates/main/index.html b/templates/main/index.html
deleted file mode 100644 (file)
index 8f91f79..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE html> 
-
-<html> 
-    <head> 
-        <meta charset="UTF-8"> 
-        <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
-        <meta http-equiv="X-UA-Compatible" content="ie=edge"> 
-        <!-- vue 불러오기 -->
-        <script src="https://unpkg.com/vue"></script> 
-        <title>schedule</title> 
-    </head> 
-    <body> 
-        <div id = 'app'>
-            <p>[[ title ]]</p> 
-        </div>
-    </body>        
-    <script>
-      new Vue({
-          delimiters: ['[[', ']]'],
-          el: '#app',
-          data: {
-              title: 'Welcome My Schedule',
-          }
-      })
-    </script>
-</html>
\ No newline at end of file