-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
firebase functions test express dep test m
- Loading branch information
1 parent
c5ebab1
commit 6e4ff63
Showing
9 changed files
with
499 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<div class="duel"> | ||
<h1>Duel</h1> | ||
<v-btn @click="sendKek()" block>kek</v-btn> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Firebase from 'firebase'; | ||
import Axios from 'axios'; | ||
export default { | ||
firebase () { | ||
return { | ||
assets: { | ||
source: Firebase.database().ref('assets'), | ||
readyCallback: function () { | ||
this.loaded = true; | ||
} | ||
} | ||
} | ||
}, | ||
data () { | ||
return { | ||
loaded: false | ||
} | ||
}, | ||
methods: { | ||
sendKek() { | ||
Axios.get('/testkek') | ||
.then(function (response) { | ||
console.log('response >>>', response); | ||
}) | ||
.catch(function (error) { | ||
console.log('error >>>', error); | ||
}); | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const functions = require('firebase-functions'); | ||
const express = require('express'); | ||
const config = require('config'); | ||
|
||
const app = express(); | ||
// const TOKEN = config.token; | ||
// const bot = new TelegramBot(TOKEN, {polling: true}); | ||
|
||
// | ||
const Telegraf = require('telegraf') | ||
|
||
const bot = new Telegraf('') | ||
|
||
// console.log('keeek >', process.env.BOT_TOKEN); | ||
|
||
bot.start((ctx) => ctx.reply('Welcome!')) | ||
bot.help((ctx) => ctx.reply('Send me a sticker')) | ||
bot.on('sticker', (ctx) => ctx.reply('👍')) | ||
bot.hears('hi', (ctx) => ctx.reply('Hey there')) | ||
bot.hears(/buy/i, (ctx) => ctx.reply('Buy-buy')) | ||
|
||
bot.startPolling(); | ||
// | ||
|
||
app.get('/testkek', function (request, response) { | ||
console.log('config >>', config.token); | ||
console.log('in keks >>>'); | ||
response.send('kek is working!'); | ||
}); | ||
|
||
// bot.on('message', (msg) => { | ||
// const chatId = msg.chat.id; | ||
// console.log('on???'); | ||
|
||
// bot.sendMessage(chatId, 'Received your message'); | ||
// }); | ||
|
||
exports.app = functions.https.onRequest(app); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "functions", | ||
"description": "Cloud Functions for Firebase", | ||
"scripts": { | ||
"serve": "firebase serve --only functions", | ||
"shell": "firebase experimental:functions:shell", | ||
"start": "npm run shell", | ||
"deploy": "firebase deploy --only functions", | ||
"logs": "firebase functions:log" | ||
}, | ||
"dependencies": { | ||
"@google-cloud/functions-emulator": "^1.0.0-beta.4", | ||
"config": "^1.30.0", | ||
"express": "^4.16.3", | ||
"firebase-admin": "~5.8.1", | ||
"firebase-functions": "^0.8.1", | ||
"node-telegram-bot-api": "^0.30.0" | ||
}, | ||
"private": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters