displaying stub info
This commit is contained in:
parent
4296f42ee7
commit
f95fe42c7f
1
.gitignore
vendored
1
.gitignore
vendored
@ -20,3 +20,4 @@ pnpm-debug.log*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
*.sqlite
|
||||
|
22
index.js
22
index.js
@ -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');
|
||||
});
|
||||
}) ();
|
||||
|
@ -3,4 +3,6 @@
|
||||
const router = require ('express')
|
||||
.Router ();
|
||||
|
||||
router.get ('log', require ('./get-log'));
|
||||
router.get ('/log', require ('./get-log'));
|
||||
|
||||
module.exports = router;
|
||||
|
29
src/components/TableView.vue
Normal file
29
src/components/TableView.vue
Normal 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>
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user