Skip to content

Commit 36fd229

Browse files
author
Vue Play
committed
Stored by Vue Play
1 parent 6db92a6 commit 36fd229

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

src/main.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ const io = feathers()
1818
io.configure(feathers.socketio(socket))
1919
io.configure(feathers.authentication())
2020

21+
const socketAuthUsers = sio('https://auth.vueplay.io', {
22+
transports: ['websocket', 'polling']
23+
})
24+
const authUsers = feathers()
25+
const socketClient = feathers.socketio(socketAuthUsers)
26+
authUsers.configure(socketClient)
27+
authUsers.configure(feathers.authentication())
28+
authUsers.use('users', socketClient.service('users'), {
29+
methods: ['count']
30+
})
31+
2132
let boot = async () => {
2233

2334
try {
@@ -33,6 +44,7 @@ let boot = async () => {
3344
})
3445

3546
app.provide('io', io)
47+
app.provide('authUsers', authUsers)
3648
app.provide('user', computed(() => user?.value))
3749
app.provide('reAuthenticate', async () => {
3850
try {

src/views/About.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
style="margin-bottom:100px;color:#15244fff;margin-top:75px;width:calc(100% - 40px);margin-left:20px"
217217
class="text-4xl md:text-slate-900 font-bold"
218218
>
219-
2500+ Registered Users 🚀
219+
{{count}} Registered Users 🚀
220220
</h2>
221221
<h2
222222
style="margin-bottom:50px;max-width:450px;color:#15244fff"
@@ -332,12 +332,24 @@
332332
import Footer from "@/components/Footer.vue";
333333
import Meta from "@/components/Meta.vue";
334334
export default {
335+
inject: ['authUsers'],
335336
components: {
336337
VueNavigator,
337338
Footer,
338339
Meta
339340
},
340-
data: () => ({}),
341+
data: () => ({
342+
count: '2500+'
343+
}),
344+
async created() {
345+
try {
346+
this.count = (await this.authUsers.service('users')
347+
.count({}))
348+
?.count;
349+
} catch (e) {
350+
console.log('err', e);
351+
}
352+
},
341353
methods: {
342354
open(url) {
343355
location.href = url;

0 commit comments

Comments
 (0)