Skip to content

Commit

Permalink
demo backend interaction (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Hollingsworth authored Dec 3, 2022
1 parent 19270f0 commit a8e3522
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import json
import logging
import os
from random import randint
from pathlib import Path
from typing import Dict, Union

Expand Down Expand Up @@ -170,7 +171,8 @@ async def upload(

@app.get("/test")
async def test():
return {"message": "Hello World"}
rint = randint(0, 100000000)
return {"message": f"Hello World: {rint}"}



Expand Down
8 changes: 7 additions & 1 deletion frontend/src/views/test.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<b> The cake is a lie. </b>
<b> The cake is a lie. {{ vardata }} </b>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
Expand All @@ -12,6 +12,11 @@ export default defineComponent({
appstore,
}
},
data() {
return {
vardata: 'not initialized',
}
},
computed: {
env() {
return import.meta.env
Expand All @@ -20,6 +25,7 @@ export default defineComponent({
async mounted() {
this.appstore.setTitle('Test')
const val = await m.Axios.getInstance().test()
this.vardata = val.data.message
m.log.debug('Test Response', val.data)
m.log.debug('mounted', import.meta.env)
},
Expand Down

0 comments on commit a8e3522

Please sign in to comment.