displaying stub info

This commit is contained in:
Timo Hocker 2020-07-29 21:13:18 +02:00
parent 4296f42ee7
commit f95fe42c7f
7 changed files with 63 additions and 8 deletions

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ pnpm-debug.log*
*.njsproj
*.sln
*.sw?
*.sqlite

BIN
db.sqlite

Binary file not shown.

View File

@ -8,6 +8,8 @@ const cookie_parser = require ('cookie-parser');
const db = require ('./lib/db');
const crypto = require ('@sapphirecode/crypto-helper');
const password_helper = require ('@sapphirecode/password-helper');
const api = require ('./lib/api');
const http_proxy = require ('express-http-proxy');
const salt = crypto.create_salt ();
const hash = crypto.hash_sha512 ('asd', salt);
@ -24,9 +26,19 @@ const user = {
const app = express ();
app.use (cookie_parser ());
app.use (body_parser.json ());
app.use (auth ((name) => {
if (name === 'timo')
return user;
return null;
}));
/*
* app.use (auth ((name) => {
*if (name === 'timo')
* return user;
*return null;
*}));
*/
app.use (api);
app.use (http_proxy ('localhost:8080'));
app.listen (3000, () => {
console.log ('listening on 3000');
});
}) ();

View File

@ -3,4 +3,6 @@
const router = require ('express')
.Router ();
router.get ('log', require ('./get-log'));
router.get ('/log', require ('./get-log'));
module.exports = router;

0
log
View File

View File

@ -0,0 +1,29 @@
<template>
<table>
<tr
v-for="(item,key) of items"
:key="key"
>
<td
v-for="i_key of Object.keys(item)"
:key="i_key"
v-text="item[i_key]"
/>
</tr>
</table>
</template>
<script>
export default {
props: {
items: {
type: Array,
required: true
}
}
};
</script>
<style>
</style>

View File

@ -1,8 +1,19 @@
<template>
<div class="home" />
<div class="home">
<TableView :items="log" />
</div>
</template>
<script>
import Vuex from 'vuex';
import TableView from '../components/TableView.vue';
export default {};
export default {
components: { TableView },
computed: { ...Vuex.mapState ({ log: (state) => state.log }) },
mounted () {
this.get_log ();
},
methods: { ...Vuex.mapActions ({ get_log: 'get_log' }) }
};
</script>