]> insang Git - back_nicezip_fastapi.git/commitdiff
index.html 뷰 테스트
authornewton-cn <insang@kakao.com>
Tue, 23 Apr 2024 09:41:25 +0000 (18:41 +0900)
committernewton-cn <insang@kakao.com>
Tue, 23 Apr 2024 09:41:25 +0000 (18:41 +0900)
app/main.py
templates/main/index.html [new file with mode: 0644]

index 5d38a6bca3f5994365af8ec7656a8c011c02156f..1b5a1c4c79adc8639772f4501f76bb323f4f197e 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)
diff --git a/templates/main/index.html b/templates/main/index.html
new file mode 100644 (file)
index 0000000..0bab955
--- /dev/null
@@ -0,0 +1,21 @@
+<html>
+    <head>
+        <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
+        <script type="module">
+            import { createApp } from 'vue'
+            
+            createApp({
+              data() {
+                return {
+                  message: 'Hello World!'
+                }
+              }
+            }).mount('#app')
+            </script>
+    </head>
+    <body>
+        <div id="app">
+            <h1>{{ message }}</h1>
+          </div>
+    </body>
+</html>
\ No newline at end of file