- Readme changes

- docker fixed version postresql
- sync [WIP]
This commit is contained in:
2023-10-07 19:10:04 +02:00
parent 6822b5eab5
commit ec35f66a88
7 changed files with 51 additions and 11 deletions
+20 -2
View File
@@ -3,10 +3,11 @@ import { ref, onMounted } from 'vue';
import axios from 'axios';
const feeds = ref([]);
const buttonText = 'Sync'
const fetchData = async () => {
try {
const response = await axios.get('feeds', {
const response = await axios.get('feeds/get', {
headers: {
'Content-Type': 'application/json',
'user-token': localStorage.getItem("user-token")
@@ -18,6 +19,23 @@ const fetchData = async () => {
}
};
async function sync() {
try {
const repsponse = await axios.post('feeds/sync', {
user_id: localStorage.getItem("user-id")
},
{
headers: {
'Content-Type': 'application/json',
'user-token': localStorage.getItem("user-token")
}
})
} catch (error) {
console.error('Error sync', error)
}
}
onMounted(() => {
fetchData();
});
@@ -26,7 +44,7 @@ onMounted(() => {
<template>
<div>
<h1>Feeds</h1>
<h1>Feeds</h1> <button @click="sync">{{ buttonText }}</button>
<div id='aricle'>
<template v-for="feed in feeds">
<h2>{{ feed.title }}</h2>
+6
View File
@@ -28,6 +28,12 @@ export default defineConfig({
secure: false,
rewrite: (path) => path.replace(/^\/feeds\/get/, ''),
},
'/feeds/sync': {
target: 'http://localhost:8001/api/v1/article/sync',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/feeds\/sync/, ''),
},
},
cors: false
},