a
This commit is contained in:
parent
878579444f
commit
7d82370fb2
3 changed files with 7 additions and 3 deletions
2
index.js
2
index.js
|
@ -13,7 +13,7 @@ app.set('trust proxy', true)
|
|||
app.use(express.static('static'));
|
||||
|
||||
app.post('/', async function (req, res) {
|
||||
let ip = req.headers.get('X-Real-IP') || req.ip;
|
||||
let ip = req.headers['X-Real-IP'] || req.ip;
|
||||
let id = 'web:' + createHash('sha256').update(ip).digest('hex');
|
||||
console.log(ip);
|
||||
id = id.slice(0, 24);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<ul id="messages"></ul>
|
||||
<form id="form" action="">
|
||||
<input id="input" autocomplete="off" />
|
||||
<button><a href='#'>Send</a></button>
|
||||
<button class='send'><a href='#'>Send</a></button>
|
||||
<button><a href='https://discord.com/invite/Wkr7PVk3cF'>Discord</a></button>
|
||||
</form>
|
||||
<script src='/index.js'></script>
|
||||
|
|
|
@ -32,3 +32,7 @@ async function main(e) {
|
|||
}
|
||||
|
||||
form.addEventListener('submit', main);
|
||||
|
||||
document.getElementById('.send').addEventListener('click',function() {
|
||||
main({preventDefault: () => {}})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue