Commit b6e78626 authored by Guillaume Vagner's avatar Guillaume Vagner
Browse files

customized namebot on website

parent d66e5437
......@@ -30,11 +30,27 @@
<div class="w3-display-middle">
<h1 class="w3-jumbo w3-animate-top">HAPPY BOTDAY!</h1>
<hr class="w3-border-grey" style="margin:auto;width:40%">
<p class="w3-large w3-center">Va sur <a href="https://t.me/happyCSbot">t.me/happyCSbot</a> pour la configuration.
<p class="w3-large w3-center">Va sur <a id="link" href="" target="_blank">t.me/</a> pour la configuration.
</p>
</div>
</div>
</body>
<script>
const Http = new XMLHttpRequest();
const url = '/namebot';
Http.open("GET", url);
Http.send();
Http.onreadystatechange = (e) => {
console.log(Http.responseText)
var a = document.getElementById("link");
console.log(a.href)
a.setAttribute('href', `https://t.me/${Http.responseText}`)
a.innerText = `t.me/${Http.responseText}`
}
</script>
</html>
\ No newline at end of file
......@@ -12,10 +12,14 @@ var { getFirstToken } = require('./requests');
const config = require('./config');
// Lancement du site
app.listen(config.website.port, '127.0.0.1', () => {
console.log(`[express] Website is up and accessible on ${config.website.protocol}://${config.website.hostname}/`);
})
// Page de base, si argument
app.get('/', function (req, res) {
// GET / : renvoie la page de base
......@@ -49,5 +53,8 @@ return getFirstToken(req.query.code, req.query.state).then(chan => {
})
})
app.get('/namebot', function (req, res) {
return res.send(config.telegram.name);
})
module.exports = app;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment